Compute Part Number (L2P_ComputePartNumber)

An opening ID is an entry point used to customize business logic. The Compute Part Number opening ID is available in the Logical to physical synchronization resources set. It is used to compute the part number of the element to be instantiated when the predefined part number of logical element is not set.

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. For the selected elements, the business rule computes the part number of the element to be instantiated corresponding to logical element, if attribute predefined part number is unset.

By default, if the attributes predefined part number is unset, the element is not synchronized. A warning is logged in the Analysis Report.

This computation rule is not triggered when the creation of physical element is not possible because:

  • The predefined part number is unset or empty.
  • The predefined part number does not correspond to any existing physical element.

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

PLM Opening ID: L2P_ComputePartNumber
Customization intent: Computation
Execution context:Client

Input Objects

Input objects must be of the following types:

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

Severity messages:

  • Severity= 0 the treatment is to be continued (no message).
  • Severity= 1 the treatment is to be continued and only a warning raised.
  • Severity= 2 the treatment is supposed to be undone.

If the business rule output L2PPreDefinedPartNumber is empty string, the element will not be synchronized. A message will be displayed based on Severity value.

If the reference is not found in database corresponding to new part number L2PPreDefinedPartNumber, the element will not be synchronized and a message will be displayed in Report.

Context Object Parameters

Parameter NameTypeRead/WriteComments
L2PPhysicalElementPLM Entity ReadThe physical element
L2PPreDefinedPartNumberString ReadThe input/ output predefined part number of the Logical element. This input string may not be empty if the reference corresponding to the predefined part number set in logical is not available in database. You may valuate this parameter with the part number which should be used for synchronization.

Sample

The following sample illustrates the syntax of the business rule:

  • If the predefined part number of a logical component returns empty, the logical component's instance name is used as predefined part number.
  • If the predefined part number is found but does not correspond to any physical component, the part number is not computed.

In both cases, a message indicates the outcome of the synchronization.

let LogPartNumber (String)
let LogInstName (String)
let ReferenceLog (RFLVPMLogicalReference)

ReferenceLog = ThisObject.Reference
LogPartNumber = ReferenceLog.GetAttributeString("V_Ens_PredefinedPartNumber")
LogInstName = ThisObject.Name

if (LogPartNumber == "")
                
                {
                Parameters.SetAttributeInteger("Severity", 1)
                Parameters.SetAttributeString("Message", "Predefined Part Number was Empty, Logical Instance Name has been used as Predefined Part Number")
                Parameters.SetAttributeString("L2PPreDefinedPartNumber", LogInstName)
                }

Else
                
                {
                Parameters.SetAttributeInteger("Severity", 2)
                Parameters.SetAttributeString("Message", "No Corresponding Physical component found for existing Predefined Part Number")  
                }