| Reference > Rule Languages > Business Action Language > BAL Constructs > in <list> |
in <list> |
PREVIOUS NEXT |
Expands the set of data that can be used by rules by enabling you to access object collections that are related to known objects.
in <list>
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.
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...
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |