Validate Attribute Value Modification in PPR Spreadsheet

This document is intended to provide a detailed guide and examples about how to write an EKL Script with opening id "PPRSpreadsheetAttributeValidation_ID".

Introduction

This Business Logic (BL) validates the attribute value modification based on predefined customer rules. 

  1. Consistency Check: The BL performs a check to ensure that the values of various attributes align with the specified rules [e.g., Length of “Description” attribute of General operation should be greater than 10]. 
  2. Error Generation: If any inconsistencies or violations of the customer rules are found, the BL generates errors. The validation result messages are also displayed and logged in the Report Manager.
  3. Commit Action Cancelled: When the BL detects errors, it prevents from committing any modifications.
  4. Error Resolution: The errors need to be addressed and resolved by the user. Once the user fixes the issues (like correcting attribute values), they can then retry the modification action 

Version – 2024x FD04 (FP.CFA 2432), 2025x FD01 (FP.CFA 2506) and 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, 2025x and 2026x documentation.

Opening ID: PPRSpreadsheetAttributeValidation_ID
Customization intent: Execution
Execution context: Client
Usage It is used to define rule to allow attribute value modification

Example 1:

The below example ensures that the Title and Description fields meet specific conditions when editing a Header operation (HOP), and that if these conditions aren’t met, an error message will pop up, preventing the attribute modification of the HOP

No Use Case
1Ensure that the "Title" field of the HOP is filled with 4 digits 
2Ensure that the "Description" field of the HOP is non-empty 
3Ensure that the "Description" field of the HOP is no longer than 40 characters 

Here we have modified the OOTB script “PPRSpreadsheetAttributeValidation_ID’ to validate the attribute values of Header Operation

In similar way it is possible to validate an OOTB/ Custom attribute on an OOTB/ Custom type.

  • Title/Description attribute value can be added and modified in below cases
    1. Create page of HOP object
    2. EDIT Property page
    3. Property page at search
    4. PPR Spreadsheet editor

PLMAttributesValuationFinalization” must be implemented to support first three cases. Refer this wiki

To validate the checks on PPR Spreadsheet, we need to use PPRSpreadsheetAttributeValidation_ID.

Logical Flow

Business Rule Sample

Detail Explanation

Validation Logic:

For V_Name Attribute:

  • The script checks if the AttributeValueString matches the pattern /d{4}, which means it expects exactly 4 digits.
  • If the value does not match this pattern, the validation fails, and the ReturnMessage is set to "Operation Name is not a 4 digit".

For V_description Attribute:

  • It checks if the length of the AttributeValueString is more than 40 characters. If it exceeds 40, the validation fails, and the message is "Length of Description cannot be more than 40 Characters".
  • If the value is empty, the validation fails, and the message is "Description cannot be empty".

 

When user tries to edit Header operation Title to “Header1” in PPR Spreadsheet editor. The BL is triggered, and the value will not be modified, and the error can be seen in Report Manager.

When user tries to edit Header operation and makes Description empty in PPR Spreadsheet editor. The BL is triggered, and the value will not be modified, and the error can be seen in Report Manager.

Now, user corrects the Title or adds the Description

After the user corrects the errors, and all validations pass, the Header Operation (HOP) is successfully edited with the Title (e.g., "4254").

 

Logic to validate the Title attribute is filled with 4digits

if(strAttributeID=="V_Name"){
          MatchPatternValue="/d{4}"
if(strAttrValue.MatchPattern(MatchPatternValue) == false)
          {
                    Validate=false
                    ReturnMessage="Operation Name is not a 4 digit"
          }
}

Logic to validate the Description attribute is non-empty and no longer than 40 chars 

if(strAttributeID=="V_description"){
       
       if(strAttrValue.Length()>40)
       {
             Validate=false
             ReturnMessage="Length of Description can not be more the 40 Characters"
       }
       if(strAttrValue.Length()==0)
       {
             Validate=false
             ReturnMessage="Description can not be empty"
       }
}       

Other Supported DELMIA Types:

When we associate this BL with type ‘DELLmiHeaderOperationReference’ the BL gets invoked on Header Operation. 

The same Business Logic can be applied to other DELMIA types to validate attributes. The validation can be extended to various types and their subtypes, such as:

For different Resource types and Engineering items (Products/ parts) the type ‘VPMReference’ can be used for customization.

Similarly, one can use below type in script for customization

  • ‘DELFmiFunctionReference’ for Mfg. Item types and their subtypes
  • ‘DELLmiGeneralSystemReference’ for General system 
  • ‘DELLmiGeneralOperationReference’ for General Operation
  • ‘DELWkiInstructionReference’ for Work Instruction
  • ‘VPMReference’ for different Resource types and Engineering items (Products/ parts)

In the example, we have used ‘DELLmiHeaderOperationReference’ type to validate the attributes 

Example 2:

This example is of attribute dependency validation, where the value of one attribute affects the validation of another attribute. This kind of validation ensures that certain conditions are met before allowing a change or modification

No Use Case
1Ensure if Time Mode is changed to “Measured Time” then Measured Time should be greater than 0s

Here we have modified the OOTB script “PPRSpreadsheetAttributeValidation_ID”  to validate the attribute values of General Operation if modification is done in PPR Spreadsheet.

In similar way it is possible to validate an OOTB/ Custom attribute on an OOTB/ Custom type.

Logical Flow

                                                                

Business Rule Sample

Detail Explanation

Validation Logic:

  • Measured Time Validation:
    • Check if Mode is changed to “Measured Time”. If yes, then Check if Measured Time value is greater than 0s
    • If its value is <=0s, the modification of value will not happen, and Error can be seen in Report Manager

When user tries to edit General operation Change Time Mode to “Measured Time” in PPR Spreadsheet editor. 


Following checks on attributes are done before General operation is modified [BL is called]:

  • If Time Mode is “Measured Time” then “Measured Time” should be greater than 0s

As above conditions are not met, modification will fail, and error can be seen in Report Manager. 

Now, user adds non-zero Measured Time and changes TimeMode to Measured Time

After the user corrects the errors, and all validations pass, the General Operation is successfully modified

Logic to validate Time Mode and Measured Time

if(strAttributeID=="V_TimeMode"){
          
          if(strAttrValue=="MeasuredTime")
          {
                    set MeasuredTime=ThisObject->GetAttributeReal("V_MeasuredTime")
                    Trace(1,"MeasuredTime ",MeasuredTime)
                    //Check if MeasuredTime is non-zero value
                    if(MeasuredTime<=0)
                    {
                    Validate=false
                    ReturnMessage="Measured Time should be greater than Os"
                    }
          }

}         

Other Supported DELMIA Types

In this example, we have used ‘DELLmiGeneralOperationReference’ type to validate the attributes 

The same Business Logic can be applied to other DELMIA types to validate attributes.

Business Rule Deployment

The below page can be referred for Business Rule deployment.

How to Deploy Business Rule

For deployment using Data Setup app following Resource set ID and opening needs to be used:

Resource Set ID:

Opening:

Reference

Documentation:  Validate Attribute Value Modification (PPRSpreadsheetAttributeValidation_ID) 

 

Author

Person of Contact - @Akansha BHASAKHETRE