2 Replies Latest reply on Jun 6, 2007 8:24 AM by blachonm

    node implemented by a taskDefinition

    blachonm

      Hi,
      Could I have an example of how to get the taskDefinition executed as a node implementatioon ?
      It looks not possible to set a task behaviour for a node by doing for instance:
      Task task = new Task(taskDefinition, null);
      node.setBehaviour(task.getTaskDefinition());
      Regards.

        • 1. Re: node implemented by a taskDefinition
          tom.baeyens

          could you give me some more context of what you are trying to accomplish ?

          the sequence

          Task task = new Task(taskDefinition, null);
          node.setBehaviour(task.getTaskDefinition());
          


          looks a bit strange to me. Normally, the XML parsing would build the task as part of the process definition

          TaskDefinition taskDefinition = ...parse from xml...;
          node.setBehaviour(taskDefinition);


          Then during execution time, the execution of the taskDefinition leads to the creation of a Task.


          • 2. Re: node implemented by a taskDefinition
            blachonm

            I get a descriptor on TaskDefinition when parsing
            AbstractDescriptor taskDefinitionDescriptor = (AbstractDescriptor)parser.parseElement(XmlUtil.element(taskElement,"TaskManual"), parse);
            and then I build the task as part of the xpdl process by doing:
            node.setBehaviour(taskDefinitionDescriptor);
            The execute() method of the taskDefinition is now executed.
            note: node.setBehaviour(taskDefinition); gave me an error previously.It was why I ask you the question.
            I have now to get the task from the task repository.
            regards,
            Marc.