Now that we've written all transformation rules, data from the legacy system is in a good shape for our model, and we can start with populating it. To extract data from the knowledge session we'll use Drools queries.
Drools query looks like a normal rule without the
'then' part. It can be executed directly from a stateful knowledge session, for example
session.getQueryResults("getAllCustomers") or by using a
QueryCommand. It returns a
QueryResults object that can contain multiple
QueryResultsRow objects. Every
QueryResultsRow instance represents one match of the query. Individual objects/facts can be retrieved from
QueryResultsRow. Drools queries are a convenient way of retrieving objects/facts from the knowledge ...