AnsweredAssumed Answered

Service Task not setting process variable

Question asked by mikepoole on Mar 22, 2012
I have a Java Service Task set up in my demo workflow diagram.

Below is the Java (please ignore the basicness of it!) that has been wrapped up in a JAR file and placed in relevant lib directories (I don;t get a ClassNotFound Exception so I'm fairly sure the code is being found)

public class ManagerAvailability implements JavaDelegate {
public boolean res;
   public void execute(DelegateExecution arg0) throws Exception {
      // TODO Auto-generated method stub
      String managerName = (String) arg0.getVariable("ManagerName");
      res = false;
      if (managerName.equalsIgnoreCase("MIKE POOLE")){
         res = true;
      if (managerName.equalsIgnoreCase("JOHN SMITH")){
         res = true;
      if (managerName.equalsIgnoreCase("FRED BLOGGS)){
         res = true;
      arg0.setVariable("ManagerAvailability", res);


In my Service Task I call the service class "MikeDemo.ManagerAvailability" and then have an exclusive gateway that has 2 options ${ManagerAvailability == true} and ${ManagerAvailability == false} but it seems to always be following the true route (which is the default setting at the start of my process

What am I doing wrong?

Many thanks