Does JBoss Rules engine (Drools) only support flat models as rule facts?

Solution Verified - Updated -

Issue

  • Several documentations show JBoss Rules (Business Rule Engine) linking different objects by attributes instead of navigating by the object graph. Is this strategy, using flat models, a recommended way to work with BRMS?
  • In BRMS 5.x releases the best practice was to create flat objects and link them by their id in the rules, for example.
public class Person{
  private int id;
}

public class Address{
private int id;

private int personId;
}

rule "old reccomendation rule"
when
    $person: Person()
        $address: Address(personId=$person.id)
then    
...
end

Does this still remain the best practice in BRMS 6.1 or should users use classes like this?

public class Person{
  private int id;
  private addresses ArrayList<Address>()
}

Environment

  • JBoss Enterprise Business Rules Management System (BRMS)
    • 5.3.x
  • Red Hat JBoss BRMS (BRMS)
    • 6.1

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