[jboss-user] [JBoss jBPM] - Problems with variables in Start-node formular
legux
do-not-reply at jboss.com
Tue Jul 28 16:29:52 EDT 2009
Hi all.
I have got the following problem.
I created a process definition with jbpm 4.
To the start-node i assigned a form where the user can select the value of two variables.
The first transition leads from start to a decision-node, where i want to evaluate the input. I assigned a DecisionHandler to do this.
Using a JUnit-Test everything wents fine.
When i deploy this to the jboss and want to start the process with the jbpm-console, the form is shown and i can select the values, but in the DecisionHandler i can't see the variables.
When i put a human task between the start node and the decision, and assign view.ftl to this node where i show the variables i can see the values and after completing this task the decisionHandler also can evaluate the variables.
Can anybody help me with this problem?
thanks,
steffen
for a better understanding of my problem i will give you a short example:
the test.jpdl.xml
| <process name="test" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start form="start.ftl" name="start1">
| <transition name="to java1" to="exclusive1"/>
| </start>
|
| <decision name="exclusive1">
| <handler class="org.jbpm.test.TestDecision"/>
| <transition name="to task1" to="task1"/>
| <transition name="to task2" to="task2"/>
| </decision>
| <task assignee="alex" name="task1">
| <transition name="to end1" to="end1"/>
| </task>
| <task assignee="alex" name="task2">
| <transition name="to end1" to="end1"/>
| </task>
|
| <end name="end1"/>
|
| </process>
|
start.ftl
| <form action="${form.action}" method="POST" enctype="multipart/form-data">
|
| <h5>Variable A</h5>
|
| <select name="varA">
| <option value="1">A1</option>
| <option value="2">A2</option>
| <option value="3">A3</option>
| </select>
|
| <br/>
|
| <h5>Variable B</h5>
| <select name="varB">
| <option value="1">B1</option>
| <option value="0">B0</option>
| </select>
| <br/>
| <input type="submit" name="Done"/>
|
| </form>
|
TestCase
| public void testProcess() throws Exception {
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("varA", "1");
| variables.put("varB", "2");
| ProcessInstance instance = executionService
| .startProcessInstanceByKey("test", variables);
| String pid = instance.getId();
|
| assertEquals(true, instance.isActive("task1"));
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246553#4246553
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246553
More information about the jboss-user
mailing list