skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : At
 

Try Corticon Now

At

SYNTAX

<Sequence> ->at(<Integer>).<Attribute1>

DESCRIPTION

Returns the value of <Attribute1> for the element at position <Integer> in <Sequence>. Another operator, such as ->sortedBy, must be used to transform a <Collection> into a <Sequence> before ->at may be used. <Sequence> must be expressed as a unique alias. See Advanced Collection Syntax for more examples of usage.
<Attribute1> may be of any data type.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

This sample Rulesheet uses ->at(2) to identify the second element of the sequence created by applying sortedBy to collection1. Once identified, the value of the string1 attribute belonging to this second element is evaluated. If the value of string1 is Joe, then boolean1 attribute of Entity1 is assigned the value of true.

SAMPLE RULETEST

A sample Ruletest provides a collection of three elements, each with a decimal1 value. Input and Output panels are shown below.