[jboss-user] [JBoss jBPM] - Re: Using Drools for jBPM decision

turpin_vincent do-not-reply at jboss.com
Thu Mar 12 10:51:21 EDT 2009


For testing, i have recreate a Decision handler based on the code below:
16:        public class DroolsDecisionHandler extends DroolsHandler implements 
  | 17:                DecisionHandler {
  | 18:            private static final long serialVersionUID = -8900810376838166513L;
  | 19:
  | 20:            public List<String> assertObjects;
  | 21:            public String workingMemoryName;
  | 22:
  | 23:            public String decide(ExecutionContext executionContext)
  | 24:                    throws Exception {
  | 25:                WorkingMemory workingMemory = getWorkingMemory(
  | 26:                        workingMemoryName, assertObjects, executionContext);
  | 27:                workingMemory.setGlobal("decision", new Decision());
  | 28:                workingMemory.fireAllRules();
  | 29:                return ((Decision) workingMemory.getGlobal("decision"))
  | 30:                        .getOutcome();
  | 31:            }
  | 32:
  | 33:        }
  | 

And I have found that the executionContext was unable to solve my objects.
For example,
(Iteration on assertObjects)

  |  ContextInstance ci = executionContext.getContextInstance();
  | 
  | while (iter.hasNext()) {
  |       objectName = (String) iter.next();
  |       object = ci.getVariable(objectName);
  |       System.out.println("object name is: " + objectName);
  |       workingMemory.assertObject(object);
  |     }
  | 
  | 
object are always null!
That shows me that object are never mapped!


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

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



More information about the jboss-user mailing list