4 Replies Latest reply on Jan 8, 2008 5:58 AM by Domenico D'Addabbo

    Nodetype decision: error when use handler class approach

    Domenico D'Addabbo Newbie

      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!