What is the best practice for returning List of objects after rule execution completes?

Solution Unverified - Updated -

Issue

  • What is the best practice when returning a java.util.List of 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 Central console. 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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content