Context Object Parameters
Parameter Names | Types | Read/Write | Comments |
---|
ErrorAttributes | List of Strings | Write | Output parameter which contains the list of the attribute identifiers which valuation lead to raise a user error.
|
ErrorMessages | List of Strings | Write | Output parameter which contains the list of the NLS error message corresponding to each ErrorAttribute. |
Policy | String | Read | Policy name. |
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)
}