[jboss-user] [JBoss jBPM] - create task at runtime

massimiliano_cuccia do-not-reply at jboss.com
Tue Jul 24 10:46:09 EDT 2007


In a process I defined an handler for a transition.
This handler should create a new task, this is the code of the handler:

TaskInstance newti = executionContext.getProcessInstance().getTaskMgmtInstance().createTaskInstance();
  | newti.setName("created at runtime");
  | newti.addComment("created after the task named 'definition1' .");
  | newti.setActorId("admin");
  | newti.setVariable("sample_var", "12345");
  | 

so, when I try to execute this task (and even other tasks) I obtains a null pointer exception executing this code

TaskController taskController = ti.getTask().getTaskController();

I'm using this code to obtains the list of variables for the executing task (so this list should contain only "sample_var" in this example)

Now, am I wrong on task creation code?
or maybe have I to retrieve the list of variables in another way?

thanks for your help
regards

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

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



More information about the jboss-user mailing list