[jboss-user] [JBoss jBPM] - Re: task-node attribute create-tasks

warfster do-not-reply at jboss.com
Wed Aug 8 12:31:06 EDT 2007


A good point "...after the node has been entered...". The api is used to:


  | ProcessInstance pi = context.newProcessInstanceForUpdate("myProcess");
  |          pid = pi.getId();
  |          context.close();
  |       
  | context = getContext();
  |       
  |          ProcessInstance pi = context.getProcessInstance(processInstanceId);
  |       
  |          TaskMgmtInstance tmi = pi.getTaskMgmtInstance();
  |       
  |          TaskMgmtDefinition tmd = tmi.getTaskMgmtDefinition();
  |       
  |          Task t = tmd.getTask(taskName);
  |       
  |          TaskInstance ti = tmi.createTaskInstance(t);
  |          ti.setActorId(actorId);
  |          ti.setName(taskInstanceName);
  |          ti.setDescription(taskInstanceDescription);
  |          ti.start();
  | 
  |          context.save(ti);
  |          context.save(pi);
  |          context.close();
  | 
  | 

This happens programmatically before the processinstance has been signalled to leave the start state. The big picture is that for any given processdefinition (project) we want to post a list of all the taskinstances associated with it.

So in answer to your question, no, the task has not been created manually w/api after the node was entered. It was created manually w/api before the node was entered. Bug had not crossed my mind. It was more of a "I'm not using it correctly" concern.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072101#4072101

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072101



More information about the jboss-user mailing list