Sorry, I meant input :=)
I figured this was possible, as this is how a typical rule engine works.
However I am struggling with the correct syntax for doing this with a
decision table in Drools. I basically have a table in which I want to modify
a fact in the ACTION clause that had not been referenced in any of the
CONDITIONS, and then execute it as follows:
public void processRules(Object... facts) {
StatelessKnowledgeSession session = threadSession.get();
if (session == null) {
logger.debug("creating/setting stateless session");
session =
knowledgeBase.newStatelessKnowledgeSession();
threadSession.set(session);
} else {
logger.debug("retrieving stateless session");
}
List factList = new ArrayList();
factList.addAll(Arrays.asList(facts));
session.execute(factList);
}
Note that this worked fine by means of declaring a global variable for the
result; however I prefer this new approach.
Thanks!
--
View this message in context:
http://drools.46999.n3.nabble.com/Setting-Non-global-Input-Variable-in-AC...
Sent from the Drools: User forum mailing list archive at
Nabble.com.