ta (Read typed attribute)

The calculation function '$ta' reads any typed attribute from an object, which can have attributes. If no explicit attribute owner is specified ('owner' parameter), the system tries to read the attribute from the input object ($input).

Syntax

$ta(attributeType,typeValue[,path[,owner]])

Parameter

Name

Description

attributeType

The qualified name of the attribute
e.g. 'de.lobster.scm.base.bto.attribute.DateAttribute'

typeValue

The attribute value type (name of the enumerated value)
e.g. 'PICKUP_REQUESTED'


Notes on attributeType and typeValue:

There is no list of available attributes and their class names or types in the manual, since there are many possible combinations, which can be extended using the corresponding dynamic enumerations.
Which attributes are accessible at all also depends on the attribute owner ($input/owner parameter).
It is therefore advisable to use a 'Typed attribute' value resolver (event handling or search configurator) to display a list of the attributes available in the context and their types.
The qualified names of the attributes and the original names of the types are then displayed in brackets.

path

An optional data field path that directly returns the value of a data field of the attribute (starting from the input object $input).

e.g. 'value.date' (Tip: here, too, we recommend that you use an 'Object field' value resolver of the event handling or the query configurator to list the available data fields) If this parameter is not specified, the entire attribute object is returned.

owner

An optional parameter that transfers the object from which the attribute is to be read.
Tip: Instead of transferring an object directly, a data field path can be specified here, relative to the input object ($input), from which the attribute owner is read.

Return value

Returns the read attribute or (if given) the value of an attribute data field (see path parameter). If the attribute owner, attribute or specified data field does not exist, null is returned.

Example

Access to the date attribute 'PICKUP_REQUESTED' of a shipment. Executed in a Calculate behaviour.

$ta(de.lobster.scm.base.bto.attribute.DateAttribute,PICKUP_REQUESTED,value.date,$el(1))

The return value is the DateRange object of the attribute.

►NOTE◄ $el(1) returns the data of the form element (element ID: 1) which loaded the shipment.