Also posted to JIRA http://jira.jboss.org/jira/browse/JBPM-288
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1"
| name="simple">
| <start-state name="start">
| <transition name="" to="fork1"></transition>
| </start-state>
| <end-state name="end"></end-state>
| <fork name="fork1">
| <transition name="fk1" to="node1"></transition>
| <transition name="fk2" to="node2"></transition>
| </fork>
| <node name="node1">
| <transition name="jn1" to="join1"></transition>
| </node>
| <node name="node2">
| <transition name="jn2" to="join1"></transition>
| </node>
| <state name="state1">
| <transition name="" to="end"></transition>
| </state>
| <join name="join1">
| <transition name="" to="state1"></transition>
| </join>
| </process-definition>
|
| package com.sample;
|
| import junit.framework.TestCase;
| import java.util.*;
|
| import org.jbpm.graph.def.*;
| import org.jbpm.graph.exe.*;
|
| public class SimpleProcessTest extends TestCase {
|
| public void testSimpleProcess() throws Exception {
|
| // Extract a process definition from the processdefinition.xml
file.
| ProcessDefinition definition =
|
ProcessDefinition.parseXmlResource("simple.par/processdefinition.xml");
| assertNotNull("Definition should not be null", definition);
|
| // Create an instance of the process definition.
| ProcessInstance instance = new ProcessInstance(definition);
| assertEquals(
| "Instance is in start state",
| instance.getRootToken().getNode().getName(),
| "start");
|
| // Move the process instance from its start state to the first
state.
| instance.signal();
| assertEquals(
| "Instance is in wait state",
| instance.getRootToken().getNode().getName(),
| "state1");
|
| Map children = instance.getRootToken().getChildren();
| Collection kids = children.values();
| for (Iterator it = kids.iterator(); it.hasNext();) {
| Token tok = (Token)it.next();
| assertTrue("Fork child token " + tok.getFullName() + "
has ended", tok.hasEnded());
| }
| // Move the process instance to the end state.
| instance.signal();
| assertEquals(
| "Instance is in end state",
| instance.getRootToken().getNode().getName(),
| "end");
| assertTrue("Instance has ended", instance.hasEnded());
| }
|
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3938416#3938416
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3938416
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user