Adding an element to a collection domain

You can add elements to a collection domain, but you cannot add elements to arrays.

In the BOM, declare a method that adds an element to a collection domain:

public static void add(java.util.Collection arg1 domain 0,* class object, object arg2)
property noTypeConversion "true"
property propagateArgumentType "true";

The BOM has no method to add an element to an array. The BAL perceives no difference between arrays and collection domains. If you add an element to an array, the BAL does not raise an error, but you get an error when the IRL is parsed.

In the following example, when parsing the IRL, Rule Designer raises an error on the second action:

definitions
set 'myItem' to an item ;
   then
add to myCollection an element from myItem ;
add to myArray an element from myItem ;