Report Custo Attributes from Logical to Corresponding Physical (L2P_ReportAttributes)

An opening ID is an entry point used to customize business logic. The Report custo attributes from logical to corresponding physical opening ID is available in the Logical to physical synchronization resources set and it is used to report the customized attributes of logical element to its corresponding physical instance during the Synchronize command.

The business logic validates the synchronization based on the Sub-type attribute.

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 Logical to Physical synchronization step of a logical element and its corresponding identified physical element. It is used to propagate the attributes of a logical instance to a physical instance.

This opening ID can either:

  • Execute the synchronization (severity=0). There is no message.
  • Execute the synchronization and a message computed from the rules context (severity=1) is displayed in the logical to physical synchronization report.
  • Forbid the synchronization and a message computed from the rules context (severity=2) is displayed in the logical to physical synchronization report.

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: L2P_ReportAttributes
Customization intent: Execution
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: The logical instance to be synchronized.
  • Parameters corresponds to the standard context. Message attribute will be displayed in the synchronization report.

    L2PPhysicalElement: The physical Instance found synchronization with logical instance (ThisObject).

Context Object Parameters

Parameter NameTypeRead/WriteComments
L2P_ReportAttributesPLM Entity ReadThe physical element.

Sample

The following sample explains how to use an opening ID to execute the Logical to Physical synchronization and to report the customized attributes of logical element to its corresponding physical instance.

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

let PhyInstance(VPMInstance)
let sLogId(STRING)
let sPhyId(STRING)
let sLogAttr(STRING)
let sPhyAttr(STRING)
let LogAttrNames(List)    /* List of attribute names */
let LogInstance(RFLVPMLogicalInstance)
let index(INTEGER)
let nbLogAttrSize(Integer)
let bHasAttr(Boolean)
let AttrType(String)
let bIfAllAttrsFound(Boolean)
let bIfAllAttrsReported(Boolean)
let bIsAtleastOneAttrFound(Boolean)
let sMessage(String)

set sLogId = ThisObject.PLM_ExternalID
set LogInstance = ThisObject
set PhyInstance = Parameters.GetAttributeObject("L2PPhysicalElement")
set bIfAllAttrsFound = true
set bIsAtleastOneAttrFound = false

if( (NULL <> LogInstance)	and (NULL <> PhyInstance) )
{
	sPhyId= PhyInstance.PLM_ExternalID	
	if(sPhyId == sLogId)
	{
		index = 1
		bIfAllAttrsReported = True
		LogAttrNames = LogInstance.ListAttributeNames("", False)
		nbLogAttrSize  = LogAttrNames.Size()
		for index while index <= nbLogAttrSize
		{
			sLogAttr = LogAttrNames.GetItem(index)
			if( (0 <= sLogAttr.Search("C_", 0,  true)) or (0 <= sLogAttr.Search("V_", 0,  true)) )
			{
				bHasAttr = PhyInstance.HasAttribute(sLogAttr)
				if(true == bHasAttr)
				{
					AttrType = LogInstance.AttributeType(sLogAttr)
					if( AttrType == "String" )
					{
						bIsAtleastOneAttrFound = true
						PhyInstance.SetAttributeString(sLogAttr, LogInstance.GetAttributeString(sLogAttr))															 
					}
					else if( AttrType == "Integer" )
					{
						bIsAtleastOneAttrFound = true
						PhyInstance.SetAttributeInteger(sLogAttr, LogInstance.GetAttributeInteger(sLogAttr))						
					}
					else if( AttrType == "Boolean" )
					{
						bIsAtleastOneAttrFound = true						
						PhyInstance.SetAttributeBoolean(sLogAttr, LogInstance.GetAttributeBoolean(sLogAttr))						
					}
					else
					{
						bIfAllAttrsFound = False
					}
				}
				else
				{
					bIfAllAttrsFound = False	
				}
			}
		}
		if( (false == bIfAllAttrsFound) and (true == bIsAtleastOneAttrFound) )
		{
			sMessage = sMessage + "Only a selected few attributes reported"
			Parameters.SetAttributeInteger("Severity", 1)
			Parameters.SetAttributeString("Message", sMessage)	
			
		}