Summary

In this chapter we've seen how to use rules to perform more complex data transformation tasks. These rules are easy to read and can be expanded without increasing the overall complexity. However, it should be noted that Drools is probably not the best option if we want to do high-throughput/high-performance data transformations.

We've seen how to write rules over a generic data type such as java.util.Map. You should try to avoid using this kind of generic data type. However, it is not always possible, especially when doing data transformation and if you don't know much about the data.

Some testing approaches were shown; the use of AgendaFilter as a way to isolate the individual rule tests. Please note that upon execution, all rules are matched and placed onto the agenda; however, only those that pass this filter are executed. ObjectFilter was used to filter facts from the knowledge session, when we were verifying test assertions.

Finally, some examples were given on how to use Drools queries. They represent a very convenient way of accessing facts in the knowledge session.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.216.36