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

Mark Proctor mproctor at codehaus.org
Fri Jun 7 06:41:33 EDT 2013


You could also just model this with jBPM.

Mark
On 7 Jun 2013, at 10:43, 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