Hi, I seem to have the same problem.
I am using jBPM3.1 (from starter kit) and Eclipse 3.1.1.
I created a process definition like in the online demo (holiday-request). The
processdefinition.xml for the start-state looks like this:
| <start-state name="enter request">
| <task name="request entry" swimlane="initiator">
| <controller>
| <variable name="start date"
access="read,write,required"></variable>
| <variable name="duration"
access="read,write,required"></variable>
| </controller>
| </task>
| <transition name="" to="evaluate request"></transition>
| </start-state>
|
So "start date" and "duration" should be required.
I wrote a test class doing the following:
| public void testHolidayRequestProcess() throws Exception {
| // Extract a process definition from the processdefinition.xml file.
| ProcessDefinition definition =
|
ProcessDefinition.parseXmlResource("holiday-request.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 waiting for request entering",
| instance.getRootToken().getNode().getName(),
| "enter request");
| assertNull(
| "Message variable should not exist yet",
| instance.getContextInstance().getVariable("message"));
| showVariables(instance.getContextInstance());
|
| // create some variables
| // ** BUG? if I comment out these 2 following lines, the process
still
| // ** goes to state "evaluate request" though the 2 required
variables
| // ** are not provided **
| instance.getContextInstance().createVariable("start date", new
java.util.Date());
| instance.getContextInstance().createVariable("duration", new
Integer(5));
| // **********************************
| showVariables(instance.getContextInstance());
|
| // Move the process instance from its start state to the first
state.
| // The configured action should execute and the appropriate message
| // should appear in the message process variable.
| instance.signal();
| assertEquals(
| "Instance is in evaluation state",
| instance.getRootToken().getNode().getName(),
| "evaluate request");
| showVariables(instance.getContextInstance());
|
| }
|
When I comment out the two marked lines (so I do not provide the required
variables), the process still is moved to the next state.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3944307#3944307
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3944307
-------------------------------------------------------
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