Validate Net/Net Group Association Links (ELE_ValidateAllocationNet)

An opening ID is an entry point used to customize business logic. The Validate the Association Link between Net/Net Group and Wires/Cables opening ID is available in the Electrical Logical Resources resource set and it is used to validate the creation or deletion of a link between a net/net group and wires/cables.

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 Net / Wire Links command.

This opening ID is used to validate:

  • wires/cables to be associated with net/net group
  • wires/cables to be un-associated with net/net group.

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

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

Input Objects

Input objects must be of the following types:

  • ThisObject: net/net group to be linked/unlinked.
  • 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 Name Type Read/Write Comments
Mode String Read Add to validate the creation of the link for new content and Remove to validate the deletion of the link for existing content.
ActionList List Read List of content on which Add or Remove are applied on.
ExistingList List Read List of content to help the user defining his business rule.

Sample

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