[jboss-user] [JBoss jBPM] - How to set Token name?

j.wozniakowski do-not-reply at jboss.com
Tue Jul 3 11:04:06 EDT 2007


Hello,

I need to set Token name when it is created. Token class allows setting name only through the constructor (setter setName() is missing). Starting the process is done like this:


  | JbpmContext context = getJbmContext();
  | ProcessDefinition pd = context.getGraphSession().findLatestProcessDefinition(definition);
  | context.setActorId(Actor.instance().getId());
  | ProcessInstance p = new ProcessInstance(pd);
  | TaskMgmtInstance taskMgmtInstance = p.getTaskMgmtInstance();
  | context.save(p);
  | TaskInstance task = taskMgmtInstance.createStartTaskInstance();
  | task.start();
  | task.end();
  | context.save(task);
  | context.close();
  | 

but ProcessInstance creates Token with empty name! 

I think the best solution would be another ProcessInstance constructor like this:


  | public ProcessInstance( ProcessDefinition processDefinition, String rootTokenName){ ... }

Is this a good idea? Feature request in Jira?

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

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



More information about the jboss-user mailing list