[JBoss jBPM] - subprocess token positioned at next node
by debnathm
Hi
I am trying to execute a subprocess but after signalling the main
process, the token seems to go past the first state of the subprocess
and position itself at the second state. I was expecting it to stop at
the first state of the subprocess.
The print statements after executing the test case are as below:
After processInstance
Node is: ProcessState(process-state1)
Subprocess node is:fork1
Please let me know what's wrong.
Thanks,
Debnath
The test case and setup details are as follows:
Test case
package com.jbpm.tutorial.subprocess;
|
| import junit.framework.TestCase;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.graph.exe.Token;
| import org.jbpm.graph.node.ProcessState;
|
| public class SubProcessTest extends TestCase {
| public void setUp()
| {
|
| }
|
| public void testSubProcess()
| {
| ProcessDefinition mainprocessDefinition = ProcessDefinition.parseXmlString(
| "<process-definition name='mainprocess'>" +
| "<start-state name='start'>" +
| "<transition to='process-state1'></transition>" +
| "</start-state>" +
| "<process-state name='process-state1'>" +
| "<sub-process name='subprocess'></sub-process>" +
| "<transition to='task-node1'></transition>" +
| "</process-state>" +
| "<task-node name='task-node1'>" +
| "<task name='TaskNode1Task'></task>" +
| "<transition to='end'></transition>" +
| "</task-node>" +
| "<end-state name='end'></end-state>" +
| "</process-definition>");
| ProcessInstance mainprocessInstance = new ProcessInstance(mainprocessDefinition);
| System.out.println("After processInstance");
|
| assertEquals(false, mainprocessInstance == null);
| Token token = mainprocessInstance.getRootToken();
| token.signal();
| assertEquals(true, token.getNode() instanceof ProcessState);
| System.out.println("Node is: " + token.getNode());
| ProcessInstance subProcessInstance = token.getSubProcessInstance();
| Token subprocessToken = subProcessInstance.getRootToken();
| System.out.println("Subprocess node is:" + subprocessToken.getNode().getName());
| assertEquals(true, subprocessToken.getNode().getName().equals("start"));
| //System.out.println("Subprocess node is:" + subprocessToken.getNode().getName());
| }
| }
The Subprocess Resolver is as follows:
| package com.jbpm.tutorial.subprocess;
|
| import org.jbpm.graph.node.SubProcessResolver;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.dom4j.Element;
|
| public class CustomSubProcessResolver implements SubProcessResolver
| {
|
| /**
| *
| */
| private static final long serialVersionUID = 1L;
|
| public ProcessDefinition findSubProcess(Element subProcessElement)
| {
| ProcessDefinition subprocessDefinition = ProcessDefinition.parseXmlString(
| "<process-definition name='subprocess'> " +
| "<start-state name='start'> " +
| "<task name='StartNodeTask'> " +
| "<assignment actor-id='user'></assignment> " +
| "</task>" +
| "<transition to='fork1'></transition>" +
| "</start-state>" +
| "<fork name='fork1'>" +
| "<transition to='task-node1' name='to_task_node_1'></transition>" +
| "<transition to='task-node2' name='to_task_node_2'></transition>" +
| "</fork>" +
| "<task-node name='task-node1'>" +
| "<task name='TaskNode1Task'>" +
| "<assignment actor-id='user'></assignment>" +
| "</task>" +
| "<transition to='join1' name='to_join_1'></transition>" +
| "</task-node>" +
| "<task-node name='task-node2'>" +
| "<task name='TaskNode2Task'>" +
| "<assignment actor-id='user'></assignment>" +
| "</task>" +
| "<transition to='join1' name='to_join_2'></transition>" +
| "</task-node>" +
| "<join name='join1'>" +
| "<transition to='end'></transition>" +
| "</join>" +
| "<end-state name='end'></end-state>" +
| "</process-definition>");
| return subprocessDefinition;
| }
|
| }
|
The jbpm.cfg.xml is as follows:
<jbpm-configuration>
|
| <bean name="jbpm.sub.process.resolver" class="com.jbpm.tutorial.subprocess.CustomSubProcessResolver" singleton="false" />
|
| </jbpm-configuration>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125510#4125510
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125510
18 years, 2 months
[Installation, Configuration & DEPLOYMENT] - Re: JBoss Service Doesnt Stop
by raghav8t2
Hi.. i am able to start and stop the service... the changes that i made in service.bat are:
:cmdStop
REM Executed on service stop
call shutdown -s 192.168.1.216 >stop.log
goto cmdEnd
added the IPAddress in the shutdown call.
now i am able to stop service using net stop jbas42svc command. but one problem is temporary files are not deleted. i checked the server.log file. this is the problem area of server.log where tmp files are not removed...
2008-02-01 17:51:56,618 DEBUG [org.jboss.system.server.Server] Deleting server tmp/deploy directory
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6213jboss-annotations-ejb3.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6214jboss-ejb3.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6215jboss-aop-jdk50.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6216jboss-aspect-library-jdk50.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6217trove.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6218jboss-bean-deployer.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6219jboss-container.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6220jboss-dependency.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6221jboss-microcontainer.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6222jasper-jdt.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6223jbossweb-extras.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6229jstl.jar
2008-02-01 17:51:56,618 DEBUG [org.jboss.util.file.Files] Failed to delete file: C:\jboss-4.2.0.GA\server\default\tmp\deploy\tmp6234jaxb-api.jar
2008-02-01 17:51:56,711 INFO [org.jboss.system.server.Server] Shutdown complete
Thanks,
Raghav.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125505#4125505
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125505
18 years, 2 months