0 Replies Latest reply: May 24, 2012 11:24 AM by Elmar Weber RSS

Error Behaviour of SAP BRM RuleEngine for Multiple Records

Elmar Weber
Currently Being Moderated

Hello,

 

I'm executing XML based rules with the SAP BRM RuleEngine on SAP NetWeaver AS 7.2 using the RuleSetContext object.

There seems to be a difference in behaviour concerning the error handling, when several records are processed. When I just pass one XML record that is processed by the rule engine an exception is thrown when the XML is not valid, e.g. has a wrong root object. When I pass multiple objects no exception is thrown when the same erronous XML is processed. The output XML for the record is just the same as the input XML without any error information.

 

My question is, how do I get information on any errors that might have occurred but are suppressed in the batch execution of the rule engine?

 

Here is the used code:

 

 

            RulesetContext ctx = ruleEngine.createRulesetContext(projectName, rulesetName);

            for (String xml : xmls) {

                ctx.add(XMLObjectFactory.createXMLObject(xml));

            }

            RulesetContext returnedCtx = ruleEngine.invokeRuleset(ctx);

            List<String> resultXmls = new ArrayList<String>();

            for (int i = 0; i < xmls.size(); i++) {

                XMLObject xmlObject = (XMLObject) returnedCtx.getReturnedFacts().get(i);

                resultXmls.add(xmlObject.getXmlString());

            }

            return resultXmls;

 

 

 

 

 

 

 

 

 

Best regards,

Elmar

 

List<String> executeRule(String projectName, String rulesetName, List<String> xmls)