[jboss-user] [JBoss jBPM] - Re: How to take a decision in java code

Jean-LucT do-not-reply at jboss.com
Fri Sep 7 07:55:09 EDT 2007


Sorry but I didn't find this file on my jbpm-jpdl-suite-3.2.1.zip file. I may have to look for another download.

But I made some progress : in fact I've now define my process like this :
   <decision name="Client actif ?">
  | <handler class="fr.jl2tho.tutorialjbpm.action.IsCustomer" />
  |       <transition name="Oui" to="Enregistrer la Question"></transition>
  |       <transition name="Non" to="Prevenir le commercial"></transition>
  |    </decision>
  | 

There is no way in using the GUI to do so and the code assist doesn't provide any clue to add the handler tag.

My class is now a DecisionHandler :
public class IsCustomer implements DecisionHandler {
  | 	private static final Logger logger = Logger.getLogger(IsCustomer.class);
  | 	public IsCustomer(){
  | 		super();
  | 	}
  | 
  | 	public String decide(ExecutionContext executionContext) throws Exception {
  | 		String maSortie="Oui";
  | 		ContextInstance contextInstance = executionContext.getContextInstance();
  |         if (contextInstance.getVariable("Nom du contact").equals("Non")) {
  |         	maSortie="Non";
  |         }
  | 
  | 		return maSortie;
  | 	}
  | 
  | 	public void setConfiguration(String Config){
  | 		
  | 	}
  | }
  | 

Im' now able to go either through the Non or Oui transition.
My last problem is that it seems to me that it goes twice through the Non transition.

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

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



More information about the jboss-user mailing list