[rules-users] RuleFlow question

Kris Verlaenen kris.verlaenen at cs.kuleuven.be
Mon Feb 2 11:43:31 EST 2009


Steve,

If you have access to the process instance, you can access the variables like this:
processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE).getVariable(variableName);

You can of course hide this behind a function or java util method if you want to hide the details.

Kris
  ----- Original Message ----- 
  From: Steven Williams 
  To: Rules Users List 
  Sent: Wednesday, January 28, 2009 11:59 PM
  Subject: [rules-users] RuleFlow question


  Hi guys,

  I am playing with the OrderExample in drools-examples and was wondering how I get access in my rules to the parameters that are sent to startProcess? e.g.

          Map<String, Object> parameters = new HashMap<String, Object>();
          parameters.put("order", order);
          parameters.put("orderId", order.getOrderId());
          parameters.put("email", emailTextField.getText());
          ProcessInstance processInstance = ksession.startProcess("org.drools.examples.process.ruleset.RuleSetExample", parameters);

  I have access to the ProcessInstance but there doesn't seem to be any clear path to the parameters.

  thanks
  Steve




------------------------------------------------------------------------------


  _______________________________________________
  rules-users mailing list
  rules-users at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090202/4537db9f/attachment.html 


More information about the rules-users mailing list