[jboss-user] [JBoss jBPM] - Re: JBPM Decision node implementation with Decision handler

dabd do-not-reply at jboss.com
Mon Jun 25 04:44:08 EDT 2007


"nageshreddy1981" wrote : Hi,
  | 
  | I am new to JBPM.
  | I am trying to implement decision node in process definiton.
  | where can i find the examples for the decision node with the decision handler implemetation.
  | Can anybody provide me with examples or links on the same.
  | 
  | Thanks in advance


I'm a newbie too but here's what I did:

Implement the interface DecisionHandler and implement the 'decide' method which returns the appropriate transition.

public class MyDecisionHandler implements DecisionHandler {

	/**
	 * Comment for serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	
	
	public String decide(ExecutionContext executionContext) throws Exception {
		String lower = (String) executionContext.getContextInstance().getVariable("lower");
		String upper = (String) executionContext.getContextInstance().getVariable("upper");
		
		if ((Integer.parseInt(upper) - Integer.parseInt(lower)) > 10) {
			return "yes";
		}
		else {
			return "no";
		}

	}


Currently you can't use the GPD to associate the handler to the decision node, so you have to edit the process definition XML by hand like this:


      
      
      
      
   



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057262#4057262

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057262



More information about the jboss-user mailing list