Rule to Get Attributes For Synchronization

An opening ID is an entry point used to customize business logic. The Schematic_GetAttributesForSynchronization opening ID allows you to synchronize the attributes of the reference and the instance of the pointing object.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when using the Synchronize Called with Main command.

Definition Description
PLM Opening ID Schematic_GetAttributesForSynchronization
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: LogicalOccurrence
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
Fact object (Input) LogicalOccurrence Read The Logical occurrence of the active system.
Command _ID (Input) Integer Read An integer, based on the command that it is used.
List_Object_Types (Input) List(string) Read The input list of object type. This is metadata types and not NLS names. For example - Piping_Logical_Valve, EnsLogicalEquipment, EleLogicalCable. The object type is logical reference.
List_List_Instance_Attr ( output) List of List Write The output list of list of the instance properties that you want to compare. Every list in this list of list corresponds to an object type.
List_List_Reference_Attr output) List of List Write The output list of list of the reference properties that you want to synchronize. Every list in this list of list corresponds to an object type.

Sample

The following sample shows how to compare attributes using the Schematic_GetAttributesForSynchronization opening ID

Let ListObjectTypes(list)
set ListObjectTypes = Parameters.GetAttributeObject("List_Object_Types")

Let ListofListRefAttrs(list)
Let ListofListInsAttrs(list)

Let i(Integer)
set i=1

for i while i<=ListObjectTypes->Size()
{
  Let ObjectType(String)
  set ObjectType = ListObjectTypes->GetItem(i)
  
  Let AttrName(String)
  Let ListRefAttrNames(list)
  Let ListInsAttrNames(list)
  
  if(ObjectType == "Piping_Logical_Valve")
  {
     set AttrName = "V_NominalSize"
	     ListInsAttrNames.Append(AttrName)
  }
  else if (ObjectType == "EnsLogicalEquipment")
  {
     set AttrName = "V_Ens_SubType"
	     ListRefAttrNames.Append(AttrName)
	 set AttrName = "V_Name"
	ListRefAttrNames.Append(AttrName)
	
	set AttrName = "V_description"
	ListInsAttrNames.Append(AttrName)                                                                                                                                                     
	
	set AttrName = "PLM_ExternalID"
	ListInsAttrNames.Append(AttrName)	
  }
  else if (ObjectType == "EleLogicalCable")
  {
     set AttrName = "V_Elec_NbGroups"
	    ListRefAttrNames.Append(AttrName)
  }
  else if (ObjectType == "EleLogicalCable")
  {
     set AttrName = "V_Elec_NbGroups"
	    ListRefAttrNames.Append(AttrName)
  }
  else if (ObjectType == "Piping_Line")
  {
     set AttrName = "V_Standard"
	    ListRefAttrNames.Append(AttrName)
      set AttrName = "V_PipeSpecification"
	    ListRefAttrNames.Append(AttrName)
      set AttrName = "V_NominalSize"
	    ListRefAttrNames.Append(AttrName)	
  }
  
 ListofListRefAttrs.Append(ListRefAttrNames) 
 ListofListInsAttrs.Append(ListInsAttrNames)
 i = i + 1  
}

Parameters.SetAttributeObject("List_List_Instance_Attr", ListofListInsAttrs)
Parameters.SetAttributeObject("List_List_Reference_Attr", ListofListRefAttrs)

A list of object types is instantiated. In this list, the input parameter, List_Object_Types, is set. Two lists of list are instantiated, one for the reference attributes and another for the instance attributes.

A loop is run for every object type, for which the EKL opening has to run for. For every object, an attribute type has to be addressed for synchronization. This attribute is appended in a list depending on whether it is an instance attribute or a reference attribute.

In this example, if the object type is Piping_Logical_Valve, an instance attribute, V_NominalSize, has to be appended to the list (ListInsAttrNames), similarly for EnsLogicalEquipment and EleLogicalCable but with a reference attribute.

These lists are appended in the lists of list depending on if they are attributes, instances, or references. These lists are set as output parameters.