Attributes Valuation Finalization Check (PLMAttributesValuationFinalization)

An opening ID is an entry point used to customize business logic. Attributes Valuation Finalization Check (PLMAttributesValuationFinalization) checks that the whole attributes valuation is consistent with some customer rules. The BL can generate errors which consequence is that the commit action is canceled. When it occurs, errors are raised and the user has to solve them to be able to commit the modifications.

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 called in the PLM New, Edit Properties and Sheet Editor dialogs when the user commits the attribute valuation (action behind the Apply, Finish or OK buttons).

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

Opening ID: PLMIAttributesValuationFinalization
Customization intent: Validation
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.
  • Validation

Context Object Parameters

Parameter NamesTypesRead/WriteComments
ErrorAttributesList of StringsWrite

Output parameter which contains the list of the attribute identifiers which valuation lead to raise a user error.

ErrorMessagesList of StringsWriteOutput parameter which contains the list of the NLS error message corresponding to each ErrorAttribute.
PolicyStringReadPolicy name.

Important: These lists are accessed in rules with GetAttributeObject API on the context. They must be set on the context with SetAttributeObject at the end of the rule ( see sample ) unless they won't be applied.

Sample

The following sample show how to check that the length of the V_description attribute + the length of the PLM_ExternalID attribute is less than 80 characters.

The resulting UI message will be the following one:

This family references the script that contains the business logic implementation, which looks like the following CATRule file:

This family references the script that contains the business logic implementation, which looks like the following CATRule file:

<Scripts>
      <Script OpeningID="PLMAttributesValuationFinalization"
              Type="MyPLMProduct"
              ScriptName="MyProductAttrFinalyzeScript" />
</Scripts>


Let Errorlist(List)
Let ErrorMessagelist(List)
Let PublishedMessage(String)
Let Error(string)
Let Description(string)
Let Id(string)
Let L=0

Validation=true

set Errorlist = Parameters->GetAttributeObject("ErrorAttributes")
set ErrorMessagelist = Parameters->GetAttributeObject("ErrorMessages")
Description=ThisObject.V_description
Id=ThisObject.PLM_ExternalID
L=Description->Length()+Id->Length()
if (L>80)
{
Validation=false
ErrorMessagelist->Append("Too long.")
Errorlist->Append("V_description")
ErrorMessagelist->Append("Too long.")
Errorlist->Append("PLM_ExternalID")
}

if (Validation == false) 
{
Parameters->SetAttributeObject("ErrorMessages",ErrorMessagelist)
Parameters->SetAttributeObject("ErrorAttributes",Errorlist)
}