[jboss-user] [JBoss jBPM] - subprocess tescase problem
btl_ayd
do-not-reply at jboss.com
Sat Jun 14 02:44:12 EDT 2008
Hi I want to execute this code but when I try it I have this error.
here is my poarent process xml code:
anonymous wrote :
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.2" name="ana">
|
|
|
| <process-state name="subprocess">
| <sub-process name="cocuk" version="1"/>
|
| </process-state>
| <end-state name="end"></end-state>
| </process-definition>
here is my child xml code:
anonymous wrote :
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.2" name="cocuk">
| <start-state name="start">
|
|
| </start-state>
|
|
|
|
| <end-state name="end"></end-state>
| </process-definition>
ana my tescase code:
anonymous wrote :
| public class Subproces extends TestCase {
|
| public void testBasicScenario() {
| ProcessDefinition superProcessDefinition = ProcessDefinition.parseXmlResource("ana/processdefinition.xml");
| ProcessDefinition subProcessDefinition = ProcessDefinition.parseXmlResource("cocuk/processdefinition.xml");
| ProcessState processState = (ProcessState) superProcessDefinition.getNode("subprocess");
| processState.setSubProcessDefinition(subProcessDefinition);
|
| ProcessInstance superProcessInstance = new ProcessInstance(superProcessDefinition);
| superProcessInstance.signal();
| Token superToken = superProcessInstance.getRootToken();
| assertSame(processState, superToken.getNode());
| ProcessInstance subProcessInstance = superToken.getSubProcessInstance();
| assertSame(subProcessDefinition, subProcessInstance.getProcessDefinition()); Token subToken = subProcessInstance.getRootToken();
|
| assertSame(subProcessDefinition.getNode("state"), subToken.getNode());
|
| subToken.signal();
|
| assertSame(subProcessDefinition.getNode("end"), subToken.getNode());
| assertTrue(subToken.hasEnded());
| assertTrue(subProcessInstance.hasEnded());
|
| assertSame(superProcessDefinition.getNode("end"), superToken.getNode());
| assertTrue(superToken.hasEnded());
| assertTrue(superProcessInstance.hasEnded());
|
|
| }
|
| }
|
when I run it this error has been occured:
org.jbpm.JbpmException: token 'Token(/)' can't be signalled cause it is currently not positioned in a node
at org.jbpm.graph.exe.Token.signal(Token.java:134)
at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:270)
at com.sub.sub.testBasicScenario(sub.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158122#4158122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158122
More information about the jboss-user
mailing list