1 Reply Latest reply on Jul 2, 2006 5:12 PM by Koen Aers

    Create ProcessDefinition by API code using an AssignmentHand

    Marco Silva Newbie

      Hi,

      I need to create process definitions 'on the fly', so I'm trying to use the Jbpm API to create a processDefinition object. All the things works, but I don't know why the AssignmentHandler doesn't work (the method assign never is called).

      My code looks like this:

      TaskNode taskNode = new TaskNode("taskNode");
      Task task = new Task("taskteste");
      Delegation delegation = new Delegation();
      delegation.setClassName(Assign.class.getName());
      task.setAssignmentDelegation(delegation);
      taskNode.addTask(task);


      At runtime, this call results null:

      processInstance.getTaskMgmtInstance().getTaskInstances()


      Debuging the processInstance, I saw that the attribute 'definition' of ProcessDefinition is null. I'm think this is why the method never is called, but I don't know how to solve this problem....

      Thanks
      Marco