Hi,
I'm having
trouble understanding how JSR-94 copes with execution sets that are distributed
over more than one source.
This is how
I do it:
// do the basic
setup
ruleServiceProvider = new
RuleServiceProviderImpl();
ruleAdministrator = ruleServiceProvider.getRuleAdministrator();
ruleExecutionSetProvider = ruleAdministrator.getLocalRuleExecutionSetProvider(null);
ruleRuntime = ruleServiceProvider.getRuleRuntime();
ruleAdministrator = ruleServiceProvider.getRuleAdministrator();
ruleExecutionSetProvider = ruleAdministrator.getLocalRuleExecutionSetProvider(null);
ruleRuntime = ruleServiceProvider.getRuleRuntime();
// create the execution set from an
XML input stream
RuleExecutionSet ruleExecutionSet = ruleExecutionSetProvider.createRuleExecutionSet(inStream, null);
RuleExecutionSet ruleExecutionSet = ruleExecutionSetProvider.createRuleExecutionSet(inStream, null);
inStream.close();
// here I would
like to do something like
ruleExecutionSet.addSomeMoreRules(inStream2);
inStream2.close();
// register the execution set & get the rule session
ruleAdministrator.registerRuleExecutionSet(uri, ruleExecutionSet, null);
ruleSession =
(StatelessRuleSession)ruleRuntime.createRuleSession(uri, null,
RuleRuntime.STATELESS_SESSION_TYPE);
// execute the
rules
List
resultList = ruleSession.executeRules(inputList);
Or,
do I have to assemble my rules in one single XML source before I
call createRuleExecutionSet?
The
referrence implementation contains a number of example XML files, which differ
in some aspects. Is there a DTD, or a more elegant way of specifying
rules?
Thanks
Tomsk
