Method to Read a Transient Attribute (INFRAComputedAttribute)

The Method to Read a Transient Attribute opening ID is used to define the method for reading the transient attribute of an object of a given type (or a given extension). It computes the transient attribute based on information available on the object. A transient attribute can be defined on a customized data model usingSpecialize Data Model and Model Customization. It is not persistent. It can be manipulated in EKL like any other attributes and it can be included in edit properties masks. To know more about transient attributes, see Model Specialization Management: Creating Specialization Types: Creating and Editing an Attribute.

Note: You can define a business rule for a given attribute or a business rule for a set of transient attributes belonging to the same type (or extension):AttributeName can be used as a criterion. It means that you can define a business rule for a given attribute and another one for another attribute. In this case, you do not need to access the attribute name in the rule.

This page discusses:

Environment: On premises only

General Information

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

Opening ID: INFRAComputedAttribute
Customization intent: Computation
Execution context:Client

Input Objects

  • ThisObject corresponds to the object that holds the transient attribute. You can access the other attributes of the object to compute the transient attribute value.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
AttributeNameString ReadContains the name of the transient attribute.
PolicyStringWrite-
ComputedValueObjectTypeWriteUse this parameter to return the value of the transient attribute.

Sample 1

The following sample shows the implementation of a transient attribute

/* this business rule returns a transient attribute which is the value of another attribute (NumberOfPerson) multiplied by 2 */
Parameters->SetAttributeReal("ComputedValue",ThisObject.NumberOfPerson*2)

Sample 2

The following sample shows the implementation of two transient attributes

/* this business rule returns a transient attribute which is the value of another attribute (NumberOfPerson) multiplied by 2 or 10*/
if (Parameters->GetAttributeString(“AttributeName”)==”Attribute1”)
Parameters-> SetAttributeReal("ComputedValue",ThisObject.NumberOfPerson*2)
else
Parameters-> SetAttributeReal("ComputedValue",ThisObject.NumberOfPerson*10