7 Replies Latest reply on Dec 21, 2011 11:29 AM by Darin Wilcox

    Rules Accessing ArrayList as Process Parameters

    Darin Wilcox Newbie

      Hello,

       

      I am using jBPM 5.1.0.Final to execute some processes.  I started a process with parameters where one of the parameters is an ArrayList<?> named "itemList".  I'm trying to access the "itemList" from within a rule using the following syntax:

       

      when

           $process : WorkflowProcessInstance()

           $a : ArrayList() from ((ArrayList)$process.getVariable("arrayList"))

      then

           System.out.println("Size: " + $a.size());

       

      However, the condition never seems to be true when I use an ArrayList (I assume the same thing would happen using any object that implements Collection).  I have used other singular objects such as String without a problem and read it properly from the process in the condition portion.  Additionally, the arrayList object is accessible in the consequence as long I don't check for it in the condition. 

       

      Can anyone tell me why the ArrayList cannot be read from the process parameters in the condition portion of a rule?

       

      Are there any options to this scenario other than loading the elements from the ArrayList into working memory and running a "from collect" on them?

       

      I have attached code that demonstrates the issue.

       

      Thanks.