[rules-users] Decision tree, Is this scenario possible in Drools 5.x, need to fire a new question based on the answer of previous

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jun 7 06:54:59 EDT 2013


Just another finite state machine, in disguise.

You could describe the Q&A + transition as data and run a single rule
until the decision's been made. You wouldn't even need Drools for that
;-)

-W


On 07/06/2013, rjr201 <rich.j.riley at gmail.com> wrote:
> I don't think it'd be too hard to model a decision tree in a .drl file.
>
> You'd need a rule for each node/transition in your graph. Something like:
>
> WHEN
>    $cn : CurrentNode( Node(name == "Is the dispute related to
> Unauthorised")
> )
>    $d : Decision ( answer = "Yes" )
>    $nextNode : Node (name == "CM disputes the charge..")
> THEN
>    retract $cn
>    retract $d
>    insert new CurrentNode($nextNode)
> END
>
> Then create rules that halt at nodes that have no transitions leading out
> of
> them (end nodes).
>
> You could then start it as a statefull session, and input the decisions one
> by one until an end node is reached.
>
> I've done that kind of thing before and it's not been too cumbersome. But
> then I don't know the context of what you are doing..
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Decision-tree-Is-this-scenario-possible-in-Drools-5-x-need-to-fire-a-new-question-based-on-the-answes-tp4024193p4024198.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list