ELE_ValidateAllocationHarnessIf active, this validation rule will be triggered each time a user tries to link / unlink to or from a harness: wires, cables, SICs, splices, connector ports. This business rule is used for the Harness Content Link command.
ExampleThe following example checks whether all components to be linked to the harness are connector components only and checks if the harness is made of less than two connectors (which is forbidden). /* Rule : ELE_ValidateAllocationHarness */ /* ThisObject : #In RFLVPMLogicalPort Parameters : #In RuleContext Validation : #Out Boolean */ let sMode (String) /* "Add" or "Remove" modes */ let ActionList (List) /* Ends to validate action on */ let ExistingList (List) /* Existing ends */ let nbActionEnds (Integer) let nbExistingEnds (Integer) let ActionEnd (RFLVPMLogicalInstance) let ExistingEnd (RFLVPMLogicalInstance) let Connector (PLMElecLogicalConnector) let i (Integer) let j (integer) set sMode = Parameters->GetAttributeString("Mode") set ActionList = Parameters->GetAttributeObject("ActionList") set ExistingList = Parameters->GetAttributeObject("ExistingList") Validation=true nbActionEnds = ActionList->Size() nbExistingEnds = ExistingList->Size() set i = 1 if (sMode == "Add") { for i while i <= nbActionEnds AND Validation == true { ActionEnd = ActionList.GetItem (i) if ActionEnd <> NULL { set Connector = ActionEnd.Reference if Connector == NULL { Validation = false Parameters.Message = "End " + ActionEnd.PLM_ExternalID + " must be a connector component" Parameters.Severity = 2 } else { Connector = NULL } } else { Validation = false Parameters.Message = "Error" Parameters.Severity = 2 } } } if (sMode == "Remove") { if ((nbExistingEnds - nbActionEnds) < 4) { Validation = false Parameters.Message = "Harness must group at least 3 connectors" Parameters.Severity = 2 } } ELE_ValidateAllocationNetIf active, this validation rule will be triggered each time a user tries to associate / un-associate to or from a net / netgroup to wires / cables. This business rule is used for the Net / Wire Links command.
ExampleThe following example checks whether or not the net / wire belongs to the same owner, and that the net must be implemented by at least three wires. If not, linking is interrupted and a message is issued. /* Rule : ELE_ValidateAllocationNet */ /* ThisObject : #In RFLVPMLogicalPort Parameters : #In RuleContext Validation : #Out Boolean */ let sMode (String) /* "Add" or "Remove" modes */ let ActionList (List) /* Ends to validate action on */ let ExistingList (List) /* Existing ends */ let nbActionEnds (Integer) let nbExistingEnds (Integer) let ActionEnd (RFLVPMLogicalInstance) let ExistingEnd (RFLVPMLogicalInstance) let NetOwner (RFLVPMLogicalReference) let WireOwner (RFLVPMLogicalReference) let LinkOwner (RFLVPMLogicalReference) let i (Integer) let j (integer) set NetOwner = ThisObject.Owner set LinkOwner = Parameters->GetAttributeObject("Owner") set sMode = Parameters->GetAttributeString("Mode") set ActionList = Parameters->GetAttributeObject("ActionList") set ExistingList = Parameters->GetAttributeObject("ExistingList") Validation=true nbActionEnds = ActionList->Size() nbExistingEnds = ExistingList->Size() set i = 1 if (sMode == "Add") { for i while i <= nbActionEnds AND Validation == true { ActionEnd = ActionList.GetItem (i) if ActionEnd <> NULL { set WireOwner = ActionEnd.Owner if WireOwner <> NetOwner { Validation = false Parameters.Message = "End " + ActionEnd.PLM_ExternalID + " must have the same lin owner" Parameters.Severity = 2 } else if WireOwner <> LinkOwner { Validation = false Parameters.Message = "End " + ActionEnd.PLM_ExternalID + " must have the same link owner of the connection" Parameters.Severity = 2 } } else { WireOwner = NULL } } else } Validation = false Parameters.Message = "Error" Parameters.Severity = 2 } } } if (sMode == "Remove") { if ((nbExistingEnds - nbActionEnds) < 4) { Validation = false Parameters.Message = "Net must be implemented by at least 3 wires" Parameters.Severity = 2 } } ELE _ValidateAllocationPinIf active, this validation rule is triggered each time a user tries to reserve a group of pins. This business rule is used for the Pin Allocation Management.
ExampleThe following example checks whether or not the reservation will contain unique named pins and checks that the reservation must have at least two pins. If not, routing is interrupted and a message issued. /* Rule : ELE_ValidateAllocationPin */ /* ThisObject : #In RFLVPMLogicalPort Parameters : #In RuleContext Validation : #Out Boolean */ let sMode (String) /* "Add" or "Remove" modes */ let ActionList (List) /* Ends to validate action on */ let ExistingList (List) /* Existing ends */ let nbActionEnds (Integer) let nbExistingEnds (Integer) let ActionEnd (RFLVPMLogicalInstance) let ExistingEnd (RFLVPMLogicalInstance) let NetOwner (RFLVPMLogicalReference) let WireOwner (RFLVPMLogicalReference) let ConnectionOwner (RFLVPMLogicalReference) let i (Integer) let j (integer) set Owner = Parameters->GetAttributeObject("Owner") set sMode = Parameters->GetAttributeString("Mode") set ActionList = Parameters->GetAttributeObject("ActionList") set ExistingList = Parameters->GetAttributeObject("ExistingList") Validation=true nbActionEnds = ActionList->Size() nbExistingEnds = ExistingList->Size() set i = 1 if (sMode == "Add") { for i while i <= nbActionEnds AND Validation == true { ActionEnd = ActionList.GetItem (i) set j = 1 for j while j <= nbExistingEnds AND Validation == true { ExistingEnd = ExistingList.GetItem (j) if (ActionEnd.PLM_ExternalID == ExistingEnd.PLM_ExternalID) { Validation = false Parameters.Message = "Pin " + ActionEnd.PLM_ExternalID + " already exists" Parameters.Severity = 1 } } } } if (sMode == "Remove") { if ((nbExistingEnds - nbActionEnds) < 2) { Validation = false Parameters.Message = "Reservation must have at least 2 pins" Parameters.Severity = 2 } } ELE_ValidateGroupConductorIf active, this validation rule is triggered each time a user groups / ungroups to or from cable / net group, other cables / wires - net groups / nets. This business rule is used for the Cable Links command.
ExampleThe following example checks whether or not the cable groups only wires and have at least three wires. If not, linking is interrupted and a message issued. /* Rule : ELE_ValidateGroupConductor */ /* ThisObject : #In RFLVPMLogicalPort Parameters : #In RuleContext Validation : #Out Boolean */ let sMode (String) /* "Add" or "Remove" modes */ let ActionList (List) /* Ends to validate action on */ let ExistingList (List) /* Existing ends */ let nbActionEnds (Integer) let nbExistingEnds (Integer) let ActionEnd (RFLVPMLogicalInstance) let ExistingEnd (RFLVPMLogicalInstance) let Wire (PLMElecLogicalWire) let i (Integer) let j (integer) set sMode = Parameters->GetAttributeString("Mode") set ActionList = Parameters->GetAttributeObject("ActionList") set ExistingList = Parameters->GetAttributeObject("ExistingList") Validation=true nbActionEnds = ActionList->Size() nbExistingEnds = ExistingList->Size() set i = 1 if (sMode == "Add") { for i while i <= nbActionEnds AND Validation == true { ActionEnd = ActionList.GetItem (i) if ActionEnd <> NULL { set Wire = ActionEnd.Reference if Wire == NULL { Validation = false Parameters.Message = "End " + ActionEnd.PLM_ExternalID + " must be a wire" Parameters.Severity = 1 } else { Wire = NULL } } else { Validation = false Parameters.Message = "Error" Parameters.Severity = 2 } } } if (sMode == "Remove") { if ((nbExistingEnds - nbActionEnds) < 3) { Validation = false Parameters.Message = "Cable must group at least 3 wires" Parameters.Severity = 2 } } ELE_ValidateGroupConnectorIf active, this validation rule is triggered each time a user groups / ungroups to or from connector port, connector ports / pins. This business rule is used for the Connector Port Links command.
ExampleThe following example checks whether or not the connector port groups only unique named pins. If not, linking is interrupted and a message issued. /* Rule : ELE_ValidateGroupConnector */ /* ThisObject : #In RFLVPMLogicalPort Parameters : #In RuleContext Validation : #Out Boolean */ let sMode (String) /* "Add" or "Remove" modes */ let ActionList (List) /* Ends to validate action on */ let ExistingList (List) /* Existing ends */ let nbActionEnds (Integer) let nbExistingEnds (Integer) let Owner (RFLVPMLogicalReference) let ActionEnd (RFLVPMLogicalPort) let ExistingEnd (RFLVPMLogicalPort) let i (Integer) let j (integer) set Owner = Parameters->GetAttributeObject("Owner") set sMode = Parameters->GetAttributeString("Mode") set ActionList = Parameters->GetAttributeObject("ActionList") set ExistingList = Parameters->GetAttributeObject("ExistingList") Validation=true nbActionEnds = ActionList->Size() nbExistingEnds = ExistingList->Size() set i = 1 if (sMode == "Add") { for i while i <= nbActionEnds AND Validation == true { ActionEnd = ActionList.GetItem (i) set j= 1 for j while j <= nbExistingEnds AND Validation == true { ExistingEnd = ExistingList.GetItem (j) if (ActionEnd.PLM_ExternalID == ExistingEnd.PLM_ExternalID) { Validation = false Parameters.Message = "Pin " + ActionEnd.PLM_ExternalID + " already exists" Parameters.Severity = 1 } } } } |