What is the best practice for returning List of objects after rule execution completes?
Issue
- What is the best practice when returning a
java.util.Listof objects as a result from the rule engine after rule execution completes? - User wants to write a rule with the following requirements in the
Business Centralconsole. For an example, user has this data model type.
public class TimelineNode{
private int timelineId;
private java.lang.String nodeName;
}
If user inserts 5000 of this type of objects to the ksession and among them a few actually had timelineId field populated but the rest won't have anything set for this field. But all of those facts have nodeName field populated. The expected result from the rule execution are those TimelineNode objects that has the input timelineId.
- There is a known way to achieve this requirement , which to create another object (for an example) ResultObject that might contain a list of TimelineNode but how can it be populated with the expected results from the rule execution?
- Is there a better way of returning this result?
Environment
- Red Hat JBoss BRMS (BRMS)
- 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
