Reference > Rule Languages > Business Action Language > BAL Constructs > in <list>

Summary

Expands the set of data that can be used by rules by enabling you to access object collections that are related to known objects.

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.

Examples

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...

Related Concepts

Rule Conditions

Related Tasks

Creating Business Rules

Related Reference

definitions
if
where <test>
there are <number> <objects>
there are at least <number> <objects>
there is at least one <object>
there are more than <number> <objects>
there is at most one <object>
there is no <object>
there is one <object>

Related Samples and Tutorials

Tutorial: Creating Business Rules