in (list)

This construct accesses data from object collections that are related to known objects.

Purpose

You use this construct to expand the set of data that can be used by a rule.

Syntax

in <list>

Description

By default, rules are used to process a set of data established by the developer of an application. If you need to access data that is not in this set, but related to data in this set, you can use the in construct to define a variable that pulls data in from a related data collection.

The in construct is used to retrieve data from a collection of objects related to an existing object. The <list> parameter of the in construct must be an expression that denotes a collection. To retrieve one distinct object from another distinct object, use the from (object) construct.

The in construct can be used in the definitions part of a rule and in count conditions specified in the if part of a rule.

Example

The following definition declares a variable as an item in the collection of shopping cart items.

definitions
    set 'item' to a CD 
        in the items of the shopping cart of the customer ;
if
    there is an item
then...

The following condition tests that there is an item in the collection of shopping cart items.

if
    there is an item
        in the items of the shopping cart of the customer ;
then...