Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
L2PPhysicalRoot | PLM Entity |
Read | The input physical root in which corresponding physical parent element is to be searched. |
L2PPhysicalFather | PLM Entity | Write | The output physical product in which the component is to be instantiated. If the business rule output L2PPhysicalFather is invalid, default behavior is applicable. |
- Additional Context Object Parameter (Case 1 only)
Parameter Name | Argument Type | Read/Write | Comments |
---|
L2PConnectorPort | EleLogicalConnectorPort |
| Valid input only when ThisObject is LogicalEquipment and the intent is to define the aggregating physical parent for the physical equipment connector to be generated. |
- Additional Context Object Parameters (Case 3 only)
Parameter Name | Argument Type | Read/Write | Comments |
---|
L2PConnectorPort | EleLogicalConnectorPort |
| Valid input only when ThisObject is EleLogicalInlineConnectorOcc and the intent is to define the aggregating physical parent for the physical single insert connector to be generated. |
L2PLogicalParent | EleLogicalHarnessOcc | | Valid input only if ThisObject is EleLogicalInlineConnectorOcc and L2PConnectorPort is valuated by a port aggregated by ThisObject in Logical.When valid, this argument holds the electrical logical system linked to the L2PConnectorPort via "harness content link". |
Sample
The following sample explains how to compute the father of electrical components.
/* CATRule signature (do not edit) : (ThisObject : #In LogicalOccurrence, Parameters : #In RuleContext) : VoidType */
let thisObjReference (RFLVPMLogicalReference)
let LogParentElem (LogicalOccurrence)
let LogicalPortElem(RFLVPMLogicalPort)
let PhysRootElem(VPMReference)
let ChildInstance(VPMInstance)
let ChildReference(VPMReference)
let Instance(VPMInstance)
Let ProductOccurrence1 (ProductOccurrence)
let listChild(LIST)
let listChild2(LIST)
let nbChild(INTEGER)
let index(INTEGER)
let index2(INTEGER)
let sName(STRING)
let sRootName(STRING)
let sInstName(STRING)
let sParentName(STRING)
let sSearchID(STRING)
let sSearchIDTitle(STRING)
let sSearchIDName(STRING)
let sMessage(STRING)
let Child(Feature)
let bParentFound(BOOLEAN)
/* Get the info from Parameters */
set PhysRootElem = Parameters.GetAttributeObject("L2PPhysicalRoot")
set LogParentElem = Parameters.GetAttributeObject("L2PLogicalParent")
set LogicalPortElem = Parameters.GetAttributeObject("L2PConnectorPort")
/* Get the name of father based on type of ThisObject */
set bParentFound = false
set sMessage ="Input enitity type is Unknown"
set thisObjReference = ThisObject.Reference
if( (true == thisObjReference.IsASortOf("EnsLogicalEquipment")) or (true == thisObjReference.IsASortOf("EleLogicalBusbar")) ) /* Equipment or Busbar*/
{
if(NULL <> LogicalPortElem) /* Place all Equipment connectors in Equipment_Connectors */
{
set sSearchIDTitle = "Equipment_Connectors"
set sSearchIDName = "Equipment_Connectors"
}
else /* Place all Equipments in Equipments */
{
set sSearchIDTitle = "Equipments"
set sSearchIDName = "Equipments"
}
}
else if ( (true == thisObjReference.IsASortOf("EleLogicalInlineConnector")) and (NULL <> LogicalPortElem) ) /* Disconnect */
{
/* Logical Disconnects have no corresponding physical. Place connectors corresponding to its port in Inline_Connectors */
set sSearchIDTitle = "Inline_Connectors"
set sSearchIDName = "Inline_Connectors"
}
else /* All other connectors are to be placed in Harness_Connectors */
{
set sSearchIDTitle = "Harness_Connectors"
set sSearchIDName = "Harness_Connectors"
}
/* Search the physical aggregating product in physical root */
if( (NULL <> PhysRootElem) and (sSearchIDTitle <> "") and (sSearchIDName <> "") )
{
sRootName = PhysRootElem.PLM_ExternalID
listChild = PhysRootElem.Children
if(listChild <> NULL)
{
index = 1
for index while index <= listChild->Size()
{
set Child = listChild->GetItem(index)
if( (Child <> NULL) and (bParentFound == false) )
{
sName = ""
set Instance = Child
set ProductOccurrence1 = Child
if(ProductOccurrence1 <> NULL)
set Instance = ProductOccurrence1.Instance
if(NULL <> Instance)
{
sName = Instance.PLM_ExternalID
}
if( (0 <= sName.Search(sSearchIDTitle, 0, true)) or (0 <= sName.Search(sSearchIDName, 0, true)) )
{
bParentFound = true
Parameters.SetAttributeObject("L2PPhysicalFather", Child)
Parameters.SetAttributeInteger("Severity", 0)
Parameters.SetAttributeString("Message", "Entity Father found")
}
if(bParentFound == false)
{
/* Add children of this reference to list of child for recusrive Search */
set ChildInstance = Child
set ChildReference = ChildInstance.Reference
set listChild2 = ChildReference.Children
if(1 <= listChild2->Size())
{
set index2 = 1
for index2 while index2 <= listChild2->Size()
{
listChild.Append(listChild2->GetItem(index2))
}
}
}
}
}
}
}
if(bParentFound == false)
{
sMessage = sMessage + "Enitity Father not found"
Parameters.SetAttributeInteger("Severity", 2)
Parameters.SetAttributeString("Message", sMessage)
}