0

I'm using JRules 6 and trying to execute a rule using the JRules API.

I create a new IlrSessionRequest object, passing a ruleset path to its constructor. When it executes, it fails, saying Syntax error in ruleset path and an error code of XU.ERROR.10048. Google isn't providing much help ..

What does the ruleset path refer to? Niaevely, I've just put in the path to the jar file that contains my XOM, but it doesn't seem to like that.

Any idea how I can find out what the ruleset path is?

DaveH
  • 7,187
  • 5
  • 32
  • 53

2 Answers2

0

The Path has to be specified in the same way it is shown on the Rule Execution Server: /ruleApp/ruleSet without any path-information. Here is a sample of the usage in JRules 7.1. This may work different on JRules 6:

String rulesetPath= "/" + "your_ruleApp" + "/" + "your_ruleset";
IlrSessionFactory factory = new IlrPOJOSessionFactory();
IlrSessionRequest request = factory.createRequest();
request.setRulesetPath(rulesetPath);
sdfx
  • 21,653
  • 4
  • 26
  • 34
0

XU = eXecution Unit so based on your explaination I would say that "JRules" is complaining because it cannot find your ruleset in your ruleapp and hence crashes.
Open the jar file (ruleapp) inside you should see at least one folder named: "your ruleapp name"
in it a folder named: "your ruleapp version" (possibly "1.0")
in it : "your ruleset name"
in it : "your ruleset version"
and in it your rule atrifacts.
Makes sense?

Possible ruleset path:
1/ ruleappName/ruleappVersion/rulesetName/rulesetVersion
2/ ruleappName/rulesetName/rulesetVersion
3/ ruleappName/ruleappVersion/rulesetName
4/ ruleappName/rulesetName

Note: Version is optional and if not specified then the latest version deployed will be used.

I coded a whole set oh Helpers and Factories for JRules (7.01 and 7.1) - some tweaks may be needed with version 6 Let me know if you are interested.

Basically there are RTSHelper and RESHelper libraries
containing static methods to create queries, business rules, extractor, ruleset, ruleapp, deploy, create a ruleset based on query and so on...
Remove ruleapp from RES after execution and a lot more...

Damien
  • 1,401
  • 9
  • 4