Last
- Last Updated: November 6, 2023
- 1 minute read
- Corticon
- Version 6.3
- Documentation
SYNTAX
<Sequence> ->last.<Attribute1>
Returns the value of <Attribute1> of the last element in <Sequence>. Another operator, such as ->sortedBy, must be used to
transform a <Collection> into a <Sequence> before ->last
may be used. <Sequence> must be expressed as
a unique alias. <Attribute1> may be of any
data type. See Advanced collection sorting syntax
for more examples of usage.
The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.
This sample Rulesheet uses ->last to identify
the last element of the sequence created by applying ->sortedBy to collection1. Once identified, the value of the string1 attribute belonging to this last element is
evaluated. If the value of string1 is Joe, then boolean1
attribute of Entity1 is assigned the value of
true.
A sample Ruletest provides a collection of three elements, each with a decimal1 value. Input and Output panels are shown below.