Adding IlrXmlObject instances by using the data driver (classic rule engine only)

Use the data driver to load an XML document into the rule engine.

About this task

One of the ways you can load an XML document into the rule engine is to add IlrXmlObject instances by using the data driver.

Procedure

To add IlrXmlObject instances by using the data driver:

Write the following code:
IlrContext context = ... // an initialized rule engine
IlrXmlDefaultDataDriver driver = ...// an initialized driver
IlrXmlObject object = ... // an initialized object

try {
   driver.assertObjects ( objects, context, null );

} catch ( IlrXmlErrorException e ) {
   // some parsing errors
}

Alternatively, to add selected classes rather than the whole tree, replace:

driver.assertObjects ( objects, context, null );

with

driver.assertObjects ( objects, context, selectedClasses );