6 Replies Latest reply on Aug 18, 2009 10:10 AM by sebastian.s

    Error in documentation regarding Implementation of DecisionH

    sebastian.s

      If you write your own Decision Class which has to implement DecisionHandler the documentation tells you to implement a method called select().

      public class ContentEvaluation implements DecisionHandler {
      
       public String select(OpenExecution execution) {
       String content = (String) execution.getVariable("content");
       if (content.equals("you're great")) {
       return "good";
       }
       if (content.equals("you gotta improve")) {
       return "bad";
       }
       return "ugly";
       }
      }
      


      When I created my own class DecisionHandler made me implement a method called decide(). I think this an error in the docs and so it should be like this:

      public class ContentEvaluation implements DecisionHandler {
      
       public String decide(OpenExecution execution) {
       String content = (String) execution.getVariable("content");
       if (content.equals("you're great")) {
       return "good";
       }
       if (content.equals("you gotta improve")) {
       return "bad";
       }
       return "ugly";
       }
      }