[jboss-user] [JBoss jBPM] - Nodetype decision: error when use handler class approach
dadajboss
do-not-reply at jboss.com
Mon Jan 7 09:53:38 EST 2008
Hi all.
Running my sample process from JBoss jBPM Console I have the error:
Error completing task: An exception of type "org.jbpm.graph.def.DelegationException" was thrown.
The sample process definition:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Process_3">
|
| <start-state name="SN-acquire">
| <task name="AcqData">
| <controller>
| <variable access="read,write" name="qta" mapped-name="qta"></variable>
| </controller>
| </task>
| <transition to="TN_display1"></transition>
| </start-state>
|
|
| <decision name="N_decision">
| <handler class="com.Process_3.decision.MyDecisionHandlerNew"></handler>
| <transition to="TN_display" name="tr_true"></transition>
| <transition to="N_end" name="tr_false"></transition>
| </decision>
|
| <task-node name="TN_display">
| <task name="DisData"></task>
| <transition to="N_end" name="to_end"></transition>
| </task-node>
|
| <task-node name="TN_display1">
| <task name="display1"></task>
| <transition to="N_decision"></transition>
| </task-node>
|
|
| <end-state name="N_end"></end-state>
|
| </process-definition>
The decide-method of the DecisionHandler implementation:
package com.Process_3.decision;
|
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.graph.node.DecisionHandler;
|
| public class MyDecisionHandlerNew implements DecisionHandler {
| private static final long serialVersionUID = 1L;
| public String decide(ExecutionContext executionContext) throws Exception {
| String quantity = (String) executionContext.getContextInstance().getVariable("qta");
| if (Integer.parseInt(quantity) > 10) {
| return "tr_true";
| }
| else {
| return "tr_false";
| }
| }
| }
Can somebody help me?
Thank you so much!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117584#4117584
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117584
More information about the jboss-user
mailing list