Business Rules

The Knowledge openness for Electrical Logical Editor lets you add your own business rules to customize and validate electrical links.

For more information about business rules, see Knowledge Expert User's Guide: PLM Customization by Rules.

ELE_ValidateAllocationHarness

If 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.

ThisObject
(RFLVPMLogicalInstance) It represents the harness to which wires / cables / sics / splices / connector ports are linked to or unlinked from.
Parameters

Standard context:


  • Mode:
    • Add mode to validate new content to link to the harness.
    • Remove mode validate existing content to unlink from harness

  • ActionList:
    • List of content on which add or remove action is done depending on mode.

  • ExistingList:
    • List of content to help the user to define easily his business rule.

  • Owner:
    • Context where the link will be realized.

  • Severity:
    • 1 (default) to raise a warning and the operation can continue.
    • 2 to raise an error and the operation is undone.

  • Message:
    • The attribute message which will be displayed in a window (warning or error depending on Severity) if the validation fails.
Validation
Parameter to set to know if the validation succeeded of failed (expected values are true or false). False value is associated to the severity of the action.

Example

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

If 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.

ThisObject
(RFLVPMLogicalInstance) It represents the "net / netgroup" to which "wires / cables" will be associated to or un-associated from.
Parameters

Standard context:

  • Mode:
    • Add mode to validate wires/cables to associate to the net/netgroup
    • Remove mode to validate associated wires/cables to un-associate to the net/netgroup

  • ActionList:
    • List of wires/cables on which add or remove action is done depending on mode.

  • ExistingList:
    • List of content to help the user to define easily his business rule.

  • Owner:
    • Context where the link will be realized.

  • Severity:
    • 1 (default) to raise a warning and the operation can continue
    • 2 to raise an error and the operation is undone.
  • Message: Attribute message which will be displayed in a window (warning or error depending on Severity) if the validation fails (false value).

Validation
Parameter to set to know if the validation succeeded of failed (expected values are true or false). False value is associated to the severity of the action.

Example

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

ELE _ValidateAllocationPin

If 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.

ThisObject
(RFLVPMLogicalInstance) It represents the electrical component defining pins occurrences.
Parameters:

Standard context:

  • Mode:
    • Add mode to validate the group of pins to reserve

  • ActionList:
    • List of pins on which action is done.

  • ExistingList:
    • Empty list.

  • Owner:
    • Context where the link will be realized.

  • Severity:
    • 1 (default) to raise a warning and the operation can continue
    • 2 to raise an error and the operation is undone.
  • Message: Attribute message which will be displayed in a window (warning or error depending on Severity) if the validation fails (false value).

Validation
Parameter to set to know if the validation succeeded of failed (expected values are true or false). False value is associated to the severity of the action.

Example

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

If 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.

ThisObject
(RFLVPMLogicalInstance) It represents the cable / net group in which cable / wire - net group / net are grouped to or ungrouped from.
Parameters:

Standard context:

  • Mode:
    • Add mode to validate new cables / wires - net groups / nets to add / group to the cable / net group.
    • Remove mode to validate existing cables / wires - net groups / nets to remove / ungroup from cable / net group.

  • ActionList:
    • List of cables / wires - net groups / nets on which add or remove action is done depending on mode.

  • ExistingList:
    • List of cables / wires - net groups / nets to help the user to define easily his business rule.

  • Owner:
    • Context where the link will be realized.

  • Severity:
    • 1 (default) to raise a warning and the operation can continue
    • 2 to raise an error and the operation is undone.
  • Message: Attribute message which will be displayed in a window (warning or error depending on Severity) if the validation fails (false value).

Validation
Parameter to set to know if the validation succeeded of failed (expected values are true or false). False value is associated to the severity of the action.

Example

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

If 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.

ThisObject
(RFLVPMLogicalPort) It represents the connector port in which connector ports / pin are grouped to or ungrouped from.
Parameters:

Standard context:

  • Mode:
    • Add mode to validate new electrical ports to add / group to the connector port.
    • Remove mode to validate existing electrical ports to remove / ungroup from cable / net group.

  • ActionList:
    • List of electrical ports on which add or remove action is done depending on mode.

  • ExistingList:
    • List of electrical ports to help user to define easily his business rule.

  • Owner:
    • Context where the link will be realized.

  • Severity:
    • 1 (default) to raise a warning and the operation can continue
    • 2 to raise an error and the operation is undone.
  • Message: Attribute message which will be displayed in a window (warning or error depending on Severity) if the validation fails (false value).

Validation
Parameter to set to know if the validation succeeded of failed (expected values are true or false). False value is associated to the severity of the action.

Example

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