[jboss-user] [JBoss jBPM] - Re: task in start state

debnathm do-not-reply at jboss.com
Wed Jan 16 03:32:24 EST 2008


Hi

I have the following state definition (fragment):

<process-definition>
  | <start-state name='start'>
  | <task name='StartStateTask'>
  | <controller>
  | <variable access='read,write,required' name='variable1' mapped-name='Var1'></variable>
  | </controller>
  | </task>
  | <transition to='task-node1' name='to_task_node1'></transition>
  | </start-state>
  | ...
I use the following code to create a process Instance:

ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
<xml string above>);

ProcessInstance processInstance = new ProcessInstance(processDefinition);


Later, I call the following code:

TaskMgmtInstance taskmgmtInstance = processInstance.getTaskMgmtInstance();
Token token = processInstance.getRootToken();
if (taskmgmtInstance.hasUnfinishedTasks(token) == false)
{
...
}
else
{
...
}

However, even though the start state has a task, it seems to
enter the "if" block, not the "else" part.

Any suggestions would be appreciated.

Thanks,

Debnath


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

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



More information about the jboss-user mailing list