Compute Corresponding Multiple Physical Elements (L2P_ComputeMultipleCorrespondingPhysicals)

An opening ID is an entry point used to customize business logic. The Compute Corresponding Multiple Physical Elements (L2P_ComputeMultipleCorrespondingPhysicals) opening ID enables the automatic creation of implement links between a logical system and several electrical physical systems.

Important: The business rule is executed only if the Allow instance links between one logical and multiple physical electrical systems option is selected. For more information, see Electrical 3D Design: Synchronizing Physical Data with Logical Data: Synchronizing a Logical System with Several Electrical Physical Systems.
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 following stages of the Logical To Physical command:

  • Scan Links
  • Synchronize

DefinitionDescription
PLM Opening IDL2P_ComputeMultipleCorrespondingPhysicals
Customization intent Computation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead or WriteComments
FactTypeAny EKL typeType of ThisObject in the business rule body.
ThisObjectRFLPVPMLogicalInstance ReadLogical element for which a physical element is computed.
L2PPhysicalRootVPMReferenceReadPhysical context in which search is performed.

Output Objects

Parameter NameTypeRead or WriteComments
L2PListOfPhysicalElementsListWriteList of physical elements corresponding to ThisObject.
L2PCreateImplementLink Boolean WriteIndicates if implement links are created during the synchronization.

After the synchronization, all outputs in L2PListOfPhysicalElements are created. The created links are based on L2PCreateImplementLink.

Sample

The following sample illustrates how to automatically link one logical system to several electrical physical systems by listing all electrical physical systems whose V_description value contains the logical system's V_description value.

/* CATRule signature (do not edit) : (ThisObject : #In RFLVPMLogicalInstance, Parameters : #In RuleContext) : #Void */

/* Rule created by KMM1 13-May-16 */ 
let physRootElem(VPMReference)
let childInst(VPMInstance)
let childRef(VPMReference)
let childOcc(ProductOccurrence)
let feat (Feature)

let listChild(List)
let listAllChild (List)
let listCorrespondingPhysicals(List)

let sDescription(String)
let sDescriptionChild(String)
let sMessage(String)

let index1(Integer)
let index2(Integer)
let nbChild(Integer)
let nbChild2(Integer)
let severity(Integer)


set physRootElem = Parameters.GetAttributeObject("L2PPhysicalRoot")
set sDescription = ThisObject.V_description

if (1 <= sDescription.Length() )
{
	/* List all children of physical context (L2PPhysicalRoot) which has same V_description as ThisObject*/
	set listAllChild = physRootElem.Children
	if(NULL <> listAllChild)
	{
		set sMessage = "Following physical elements are found based on description: " 
		set index1 = 1
		for index1 while index1 <= listAllChild.Size()
		{
			set feat = listAllChild.GetItem(index1)
			set childInst = feat
			set childRef = feat
			set childOcc = feat
			
			/* Only child of type VPMReference/ VPMInstance/ ProductOccurrence are valid to link with the system. Other types e.g. Representation should be ignored */
			if ( (NULL <> feat) and ( (NULL <> childInst) or (NULL <> childRef) or (NULL <> childOcc)) )
			{
				if(NULL <> childInst)
			          		set childRef = childInst.Reference
				else if(NULL <> childOcc)
			          		set childRef = childOcc.Reference
			        	if(NULL <> childRef)
			        	{
					set sDescriptionChild = childRef.V_description
			          		if(0 <= sDescriptionChild.Search(sDescription, 0, true))
			          		{
			            			set severity = 0 /* If at least one physical system is found return severity = 0*/
			            			listCorrespondingPhysicals.Append(feat)
			            			set sMessage = sMessage + " " + feat.Name
			          		}
					
					set listChild = childRef.Children
					if(NULL <> listChild)
					{
						set index2 = 1
						for index2 while index2 <= listChild.Size()
						{
							listAllChild.Append(listChild.GetItem(index2))
						}
					}
					
			        	}
			}	
		}
		if(0 >= listCorrespondingPhysicals.Size())
		{
			set severity = 1
		      	sMessage = "Computation FAILED : None of the direct children has same description as ThisObject"
		}
	}
}
else
{
  set severity = 2
  set sMessage = "Computation FAILED : Description unset on ThisObject" 
}

Parameters.SetAttributeObject("L2PListOfPhysicalElements", listCorrespondingPhysicals)
Parameters.SetAttributeBoolean("L2PCreateImplementLink", TRUE) 
Parameters.SetAttributeInteger("Severity", severity)
Parameters.SetAttributeString("Message", sMessage)