[jboss-user] [JBoss jBPM] - Re: task in start state
debnathm
do-not-reply at jboss.com
Wed Jan 16 06:02:17 EST 2008
Hi
Here is the JUnit test case. Please check if the APIs have
been used correctly
Thanks,
Debnath
package org.jbpm.tutorial.startstatetask;
|
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.graph.exe.Token;
| import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
|
| import junit.framework.TestCase;
|
| public class StartStateTask extends TestCase {
| public void testStartStateTask() {
|
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
| "<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> " +
| " <task-node name='task-node1'> " +
| " <task name='SecondTask'>" +
| " <controller> " +
| " <variable access='read,write,required' name='variable2' mapped-name='Var2'></variable>" +
| " </controller> " +
| " </task> " +
| "<transition to='end' name='to_end'></transition>" +
| "</task-node>" +
| "<end-state name='end'></end-state>" +
| "</process-definition>");
|
| ProcessInstance processInstance =
| new ProcessInstance(processDefinition);
|
| Token token = processInstance.getRootToken();
| TaskMgmtInstance taskmgmtInstance = processInstance.getTaskMgmtInstance();
| assertEquals(true, taskmgmtInstance.hasUnfinishedTasks(token));
| }
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120378#4120378
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120378
More information about the jboss-user
mailing list