Validate Links between Electrical Ports (ELE_ValidateGroupConnector)

An opening ID is an entry point used to customize business logic. The Validate links between electrical ports opening ID is available in the Electrical Logical Resources resource set and it is used to validate the grouping/ungrouping of electrical ports/pins under a connector port.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked during the Connector Port Links command.

This opening ID is used to validate:

  • new electrical ports/pins to be grouped to a connector port
  • existing electrical ports/pins to be ungrouped from a connector port.
The links between pins / connector ports and a connector port when pins / connector ports are grouped or ungrouped to a connector port.

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: ELE_ValidateGroupConnector
Customization intent: Validation
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: the connector port the grouped/ungrouped the connector ports/pins
  • Parameters: corresponds to the context object
  • Validation: parameter to be set to know if the validation succeeded or failed (expected values are TRUE or FALSE). False value is associated with the severity of the action.
  • Severity information:
    • Severity= 0: the treatment is to be continued (no message).
    • Severity= 1: the treatment is to be continued and only a warning raised.
    • Severity= 2: the treatment is supposed to be undone.

Context Object Parameters

Parameter NameTypeRead/WriteComments
ModeString ReadAdd to validate the creation of the link for new content and Remove to validate the deletion of the link for existing content.
ActionListListReadList of content on which Add or Remove are applied on.
ExistingListListReadList of content to help the user defining his business rule.

Sample

The following sample 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
            }
       }
   }
}