Notifying a XU on Java SE of a ruleset update
In a Java™ SE application, you can notify the execution unit (XU) that a ruleset is no longer valid because it has been updated.
About this task
To notify the execution unit (XU) of a ruleset update on Java SE, you create a management session from a Java SE rule session factory, you retrieve the canonical ruleset path, and you pass the IlrManagementSession.IlrManagementSession#invalidate(ilog.rules.res.model.IlrPath) method on the instance of management session bean. This method takes a canonical ruleset path. To retrieve the canonical ruleset path, use the IlrManagementSession#solveRulesetPath(ilog.rules.res.model.IlrPath) method. When a ruleset is invalidated, that ruleset is parsed at the next request. Therefore, this action might significantly affect performance.
- The Java SE XU does not run in the same Java virtual machine (JVM) as the Rule Execution Server console.
- The Java SE XU runs outside the application server cluster to which the Rule Execution Server is deployed.
Procedure
Example
IlrJ2SESessionFactory sessionFactory = new IlrJ2SESessionFactory(new PrintWriter(System.out));
IlrManagementSession managementSession = sessionFactory.createManagementSession();
IlrPath rulesetPath = IlrPath.parsePath("/RuleApp/1.0/RuleSet/1.0");
managementSession.invalidate(rulesetPath);