General InformationThis opening ID is invoked during the analysis of the logical components to be placed in the physical structure. This opening ID is used in various synchronization cases:
The table below provides you with information related to the definition of the Opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe 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)
}
| |||||||||||||||||||||||||||||||||||||||||||||