Quantcast
Channel: SCN : Popular Discussions - SAP Business Rules Management
Viewing all articles
Browse latest Browse all 1717

Help invoking decision table using Business Rules Engine API in 7.31

$
0
0

Hi Experts,

 

Im trying to invoke a decision table in a re-usable rule set using the BRM API in NW 731 Process orchestration, but Im not getting the desired result and havent been able to pin point what is wrong:

 

I have a re-usable rule set , with a decision table. The decision table takes a string value and returns two relevant string values. The Strings have been defined as common definitions in the project resources.

 

In my code I first get an instance of the rule engine, and then a RuleSetContext. Then i set the entity type of the context to Decision Table passing in the name of the table i want to invoke. I then add input to the context and invoke the engine. I get the returned context and from that i get the returned facts. I do all that as follows:

 

 

 

 

 String jndiName = "com.sap.brms.RuleEngine";   Object obj = context.lookup(jndiName);  RuleEngineHome home = (RuleEngineHome)PortableRemoteObject.narrow(obj, RuleEngineHome.class);  RuleEngine engine = home.create();  RulesetContext ctxt = engine.createRulesetContext("demo.nl~rules","ReusableRuleSet");  ctxt.setEntity(EntityType.DECISION_TABLE, "DecisionTable1");  String input = "1000";   ctxt.add(input);  RulesetContext returnedContext = engine.invokeRuleEntity(ctxt);  List returnedFacts = returnedContext.getReturnedFacts();

 

I expected that the list of returned facts would contain the output of the decision table, but when I print it to system out I see only the values which I passed in.

 

Can anyone provide any pointers? I would like to avoind calling the decision table as a service.

 

Kind Regards

Adam


Viewing all articles
Browse latest Browse all 1717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>