This document is intended to provide a detailed guide and examples about how to write an EKL Script with opening id 'PLMAttributesPropagation'
Introduction
Attributes Valuation Propagation (PLMAttributesPropagation) (BL) script can be used to achieve the following objectives:
- You can use this BL to dynamically update the value of one attribute depending on the value of another attribute. This is commonly needed where attributes are interdependent.
- To make certain attributes read-only, ensuring that they cannot be modified by users directly but can be set programmatically.
- To limit the possible values of an attribute to a predefined set of values, often pulled from an external source like a file.
Version – 2024x FD04 (FP2432), 2025x FD01 (FP.CFA 2506), 2026X GA
Pre-requisites:
Licenses
- PPL (Process Engineer): Required to create Mfg. Item Structure, Process objects and Work Instructions
Disclaimer: Licenses mentioned above are as per 2024x documentation.
| Opening ID: | PLMAttributesPropagation |
| Customization intent: | Execution |
| Execution context: | Client |
| Usage | This Opening ID is triggered whenever a New or Edit Properties dialog box displays/modifies an attribute. |
Limitations:
- If in the PLM mask (creation/edition) an attribute is declared as not editable, then the opening cannot overwrite this rule.
Example 1: Set Authorized Attribute Value
Disclaimer: Please be aware that reading the CSV file with each BL trigger may impact performance, particularly with large files.
In some cases, the values for a specific attribute may not be fixed and could change or increase over time. To accommodate such changes and make the process more flexible, it's ideal to read these values from an external CSV file and populate the dropdown list dynamically.
The below example reads CSV file which has various Task Types needed for an operation and this BL will loads them on the attribute “Custom_TaskType” in dropdown when user opens the Properties page of General operation Type.
| No | Use Case |
| 1 | Read CSV and set authorized value for Custom_TaskType |
CSV file path: “
The values for the Custom_TaskType attribute are stored in the input CSV file located in the reffiles folder within the installation directory. The first column of the CSV file contains the list of Task Type values for Operations.
Please refer below image for input csv file.
Template CSV Format:
- The Custom_TaskType attribute can be accessed/edited in following ways
- Create page of General operation object
- EDIT Property page
Property page at search
BL will be triggered for all above cases
Note: You can use this BL for existing attributes. However, if a mask is defined, the selection will be limited to the values specified within the mask. It will not be possible to add any values outside of what the mask allows
Logical Flow
Business Rule Sample
Detail Explanation
When the user creates a General operation in the Process Planning app, the properties page for the General operation opens, and a Business Logic (BL) script is triggered.
This BL will populate the dropdown for the Custom_TaskType attribute with authorized values from a CSV file.
Note: The authorized values in the CSV can be updated in the future. If new task types like "Painting" need to be added, the user will modify the CSV, and the dropdown will be updated to reflect these changes
Logic to open csv file
For iIdxReffilePath while iIdxReffilePath <= iSizeReffilePaths
{
let strTempPath (String)
strTempPath = oListReffilePaths.GetItem(iIdxReffilePath)
strTaskTypeConfigFilePath = strTempPath + "\\\\" + strTaskTypeFileName
set oTaskTypeConfigFile = OpenTextFile(strTaskTypeConfigFilePath, "r")
if(NULL <> oTaskTypeConfigFile)
{
break
}
}Logic to read csv file:
strLineValue = oTaskTypeConfigFile->Read()Logic to set Authorized values:
if (oTaskTypeConfigFile <> NULL)
{
iRow = 1
strLineValue=NULL
liTaskTypeList.RemoveAll()
for iRow while strLineValue <> ""
{
strLineValue = oTaskTypeConfigFile->Read()
Trace (1,"strLineValue: ",strLineValue)
if(strLineValue<>"")
{
liTaskTypeList-> Append(strLineValue)
}
iRow = iRow + 1
}
}
pTaskTypeAttr.AuthorizedValues=liTaskTypeListOther Supported DELMIA Types
When we associate this BL with type ‘DELLmiGeneralOperationReference’ the BL gets invoked on General operation.
The same Business Logic can be applied to other DELMIA types.
Similarly, one can use below type in script for customization
- ‘DELLmiGeneralSystemReference’ for General system
- ‘DELFmiFunctionReference’ for Mfg. Item types
- ‘DELWkiInstructionReference’ for Work Instruction
- ‘VPMReference’ for different Resource types and Engineering items (Products/ parts)
Example 2: Attribute Dependency and Read-Only Logic for Custom Attributes
| No | Use Case |
| 1 | If attribute “Outsourced” is set as Yes then set Attribute “Planning Required” as No |
| 2 | If custom attribute “Custom_Verification” is set as Yes, append “V_” as prefix and timestamp as suffix on Title |
| 3 | If custom attribute “Custom_Verification” is set as No, remove “V_” prefix and timestamp as suffix on Title if any |
| 4 | Attribute “Custom_ERP_PartNumber” should be read-only |
Note: "Enterprise Item Number" attribute is available on both Eng Item and Mfg Item. The example to make "Custom_Part_Number" as read only is for demonstration purpose.
This business logic (BL) will handle the following use cases related to attribute dependency and read-only enforcement:
- Setting Read-Only Attributes:
- When an attribute like Custom_ERP_PartNumber is copied from the EBOM (Engineering Bill of Materials) to the MBOM (Manufacturing Bill of Materials), it should become read-only at the MBOM level. This prevents the user from modifying the value at the MBOM side.
Note: Attribute copy from EBOM to MBOM is detailed in another wiki. Refer this wiki.
- Handling Attribute Dependencies:
- If the Outsourced attribute is set to Yes, the Planning Required attribute should automatically be set to No and vice-versa
- If the custom attribute Custom_Verification is set to Yes, the Title attribute will be prefixed with "V_" and suffixed with a timestamp.
- If the custom attribute Custom_Verification is set to No, the V_ prefix and timestamp suffix will be removed from the Title attribute.
Note: Custom attributes "Custom_Verfication and Custom_ERP_PartNumber" are created on Manufacturing Assembly and Provide type to demonstrate the use-case
- BL will be triggered in below cases
- Create Property Page
- EDIT Property page
- Property page at search
Logical Flow
Business Rule Sample
Detail Explanation
Input parameter "EditAttributeId" identifies the attribute that has been modified and whose edition requires propagation.
Input parameter "Propagation Mode" specifies if the propagation must be performed on
- on attribute value ["PropagationMode" value will be "Valuation"] or
- on attribute visibility only ["PropagationMode" value will be "Edition"].
Scenario1: Setting Custom_ERP_PartNumber as Read-only
- The user creates an MBOM (Manufacturing Bill of Materials) from an EBOM (Engineering Bill of Materials).
- Once the MBOM is created, the user opens the Properties Page of one of the assemblies within the MBOM. At this point, the Business Logic (BL) is triggered automatically.
The
Custom_ERP_PartNumberattribute, which was copied over from the EBOM, will be set as read-only in the MBOM. This prevents the user from modifying theCustom_ERP_PartNumberat the MBOM level, ensuring that the part number remains consistent with the original EBOM.
Logic:
Let pConstAttrPointer(ValuePointer)
pConstAttrPointer = ThisObject->GetAttributeValuePointer("Custom_ERP_PartNumber")
if(pConstAttrPointer <> NULL)
{
pConstAttrPointer.Constant = true
}Scenario 2: Modifying "Outsourced" Attribute
The user modifies the Outsourced attribute from No to Yes. The Business Logic (BL) is triggered automatically when the attribute Outsourced is updated. When the Outsourced attribute is set to Yes, the Planning Required attribute will be automatically updated and set to No by the BL.
Logic:
//Attribute dependency case of Outsourced and planning required
If( Parameters->GetAttributeString("EditAttributeId")== "V_Outsourced")
{
if(ThisObject->HasAttribute("V_Outsourced") == true)
{
Trace(1,"V_Outsourced is present")
If(ThisObject.GetAttributeString("V_Outsourced") == "Yes")
{
ThisObject->SetAttributeString("V_NeedDedicatedSystem","NO")
}
else
{
ThisObject->SetAttributeString("V_NeedDedicatedSystem","YES")
}
}
}Scenario 3: Modifying "Custom_Verification" Attribute to Yes
The user changes the Custom_Verification attribute value to Yes. The Business Logic (BL) is triggered automatically when the Custom_Verification attribute is updated to Yes. The Title attribute will be modified by appending the prefix "V_" and adding the current timestamp as the suffix.
Logic:
If( Parameters->GetAttributeString("EditAttributeId")== "Custom_Verification")
{
if (ThisObject->HasAttribute("Custom_Verification") == true)
{
set now = BuildDate()
set nowString = DateFormat("%d%m%y%H%M%S", now)
If(ThisObject.GetAttributeString("Custom_Verification") == "Yes")
{
Trace(1,"Custom_Verification is Yes")
set Title = ThisObject.V_Name
set index = Title.Search("V_")
if(index <> 0)
{
set NewTitle="V_"+Title
set index = NewTitle.Search("|")
if(index < 0)
{
NewTitle = NewTitle + "|"+nowString
Trace (1,"NewTitle=========> ",NewTitle)
}
ThisObject.SetAttributeString("V_Name",NewTitle)
}
}
}
}Scenario 4: Modifying "Custom_Verification" Attribute to No
The user changes the Custom_Verification attribute value to No. The Business Logic (BL) is triggered automatically when the Custom_Verification attribute is updated to No. The Title attribute will be modified again by removing the "V_" prefix and the timestamp suffix if they exist.
Logic:
If( Parameters->GetAttributeString("EditAttributeId")== "Custom_Verification")
{
if (ThisObject->HasAttribute("Custom_Verification") == true)
{
set now = BuildDate()
set nowString = DateFormat("%d%m%y%H%M%S", now)
If(ThisObject.GetAttributeString("Custom_Verification") == "No")
{
set Title = ThisObject.V_Name
set index = Title.Search("V_")
if(index ==0)
{
set length = Title.Length()
set NewTitle = Title.Extract(2,length-2)
ThisObject->SetAttributeString("V_Name",NewTitle)
set index = NewTitle.Search("|")
if(index >= 0)
{
set NewTitle = NewTitle.Extract(0,index)
ThisObject.SetAttributeString("V_Name",NewTitle)
}
}
}
}
}Other Supported DELMIA Types
In this example, we have used ‘DELFmiFunctionReference’ type.
The same Business Logic can be applied to other DELMIA types.
Business Rule Deployment
The below page can be referred for Business Rule deployment.
For deployment using Data Setup app following Resource set ID and opening needs to be used:
Resource Set ID:
Opening:
Fact Type for Example 2: 'DELFmiFunctionReference’
Reference
Documentation: Attributes Valuation Propagation (PLMAttributesPropagation)
Author
Person of Contact: @Akansha BHASAKHETRE
