3 Replies Latest reply on Dec 2, 2005 5:18 PM by Koen Aers

    Execution - TaskInstance

    Tran Lap Newbie

      Hi all.
      I have an class for action event in GPD.

      <event type="task-create">
       <action class="jbpm.Create"/>
      </event>

      Class:
      public class Create implements ActionHandler {
      
       private static final long serialVersionUID = 1L;
      
       public void execute(ExecutionContext executionContext) throws Exception {
       System.out.println("=======");
       ArrayList list=new ArrayList();
       list.add("first");
       list.add("second");
       executionContext.setVariable("list", list);
       System.out.println("===================");
       }
      }

      And then in TaskBean.java of jbpm.war
      in initialize() function i add:
      System.out.println("====== read my data =======");
      
       myData = (List)taskInstance.getVariable("list");
       if (myData!=null){
       for (int i=0;i<myData.size();i++){
       System.out.println((String)myData.get(i));
       }
       }
       System.out.println("============================");

      This code is correct but myData is null.
      Why? I am wrong?
      Help me please.
      Thanks