I have a requirement to loop through a set of records and compare the start date in each record with current date and output a message in the Action part of the rule. I am trying to find out if I can use an arraylist in ILOG/ODM rule XOM and use it in the rule to loop through the set of records. Can you please suggest me the best way to implement this requirement.
Using an Arraylist in ILOG/ODM to loop through a set of records
2.5k views Asked by user2980176 At
2
There are 2 answers
0
On
You can follow the instructions in the ODM Blogs on developerWorks under "iterating over input parameters" topic.
It can be found here:
Iterating over Input Parameters
Basically you are going to a virtual method for your ArrayList to retrieve an entry at particular loop index. The virtual method will cast the entry before returning it, but from there you should be able to perform any rule on that object.
Note that you cannot use ArrayList as an input parameter for Dynamic XOM but you can use Arrays for input parameter with a Java XOM.
Yes, you can use an arraylist in rule XOM, and iterate over it in the rule. Let's assume your rule project takes an instance of your XOM class as an input parameter with the verbalization 'test'. You would have something like below.
XOM:
BOM Verbalization:
Rule: