JBoss Community

Re: Rules Accessing ArrayList as Process Parameters

created by Maciej Swiderski in jBPM - View the full discussion

Darin, after spending some time on this issue I came up with following (that seems to be working fine):

 

package org.zoikks.drools
 
import java.util.ArrayList;
import java.util.List;
import org.drools.runtime.process.WorkflowProcessInstance;
 
rule "Sample Rule"
ruleflow-group "testgroup"
  
  when
        $process : WorkflowProcessInstance()
        $a:  ArrayList()
              from collect( String() from $process.getVariable("arrayList"))
  then 
                    System.out.println("Sample Rule run successfully.");
                    System.out.println("Count: " + $a.size());
end
 

 

Somehow $process.getVariable() returns strings instead of entire array list.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community