11 Replies Latest reply on Oct 6, 2008 5:05 AM by Sascha Janz

    dynamically create tasks

    Sascha Janz Master

      i got the following code to generate dynamically tasks on a node.

       public Object execute(JbpmContext jbpmContext) throws Exception {
       // TODO Auto-generated method stub
       // TODO Auto-generated method stub
       Boolean b;
       try {
       b = Boolean.TRUE;
       ProcessInstance pi = jbpmContext
       for (int i = 0; i < actors.size(); i++) {
       String actor = (String) actors.get(i);
       TaskInstance ti = pi.getTaskMgmtInstance()
       } catch (Exception e) {
       // TODO: handle exception
       b= Boolean.FALSE;
       return b;

      sometimes i got a nullpointer exception on

      TaskInstance ti = pi.getTaskMgmtInstance()

      the processid is set correct.

      any idea what might be wrong?