Creating objects in the master ruleset and using them in the child ruleset
It is important to understand how objects that are created in the master ruleset are also used in the child ruleset.
Consider the following scenario:
- The master ruleset creates an instance a of a class A, and passes it to the child ruleset.
- The child ruleset has rules that use a.

When the master ruleset creates instances of A, they are in a different class loader from the one expected by the child ruleset. It might prevent the rules from working correctly.
The solution is to define the managed XOM class loader of the master ruleset (MXOM 1) as the parent of the managed XOM class loader of the child ruleset (MXOM 2). In a class loader mode parent first, the class loader loads the class of MXOM 1 class loader first, and then finds the class in MXOM 1.

This is achieved by using the following code in the RulesetChildRunner
class:
cfg.setXOMClassLoader(RulesetChildRunner.class.getClassLoader());
It
assumes that the RulesetChildRunner class is in the managed XOM of the master
ruleset. If it is not the case, you must use another way to get the class loader of the managed XOM
of the master ruleset.