Default Rule in Decision Table

215 views
Skip to first unread message

Giovanni Persico

unread,
Jun 29, 2018, 9:32:41 AM6/29/18
to Drools Usage
Hi,

Is possible to set a default rule in a decision table ( in drools workbench)?
What I try to do is that if no rule is fired from my table, then I want a default message.
Is possible?

Thanks Guys!!

Abhijit Humbe

unread,
Jul 1, 2018, 10:46:18 PM7/1/18
to drools...@googlegroups.com
There is no such default rule. But if you can define rule which dont have any condition in when block. This rule will be executed everytime, no matter if other rules are executed or not.

Abhijit Humbe

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/d8ccbd5a-a931-49e3-998a-4ad0596891fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Ramos

unread,
Jul 3, 2018, 6:32:19 PM7/3/18
to Drools Usage
Hi Giovanni,

    Did you mean this?

//Rule #4

rule "Row 4 GDT_Prazos"
activation-group "first-hit-policy-group GDT_Prazos"
dialect "mvel"
when
f1 : DO_Prenotacao( tipoTitulo not in ( "Rule#1", "Rule#2", "Rule#3" ) )
then
f1.setPrazoInicio( calculaData( f1.getDataPrenotacao(), 1 ) ) 
f1.setPrazoTermino( calculaData( f1.getDataPrenotacao(), 30 ) ) 
end


Best regards,
Alexandre Ramos
Capturar.JPG

Giovanni Persico

unread,
Jul 4, 2018, 6:10:15 AM7/4/18
to Drools Usage
Yes Perfect! Thanks so much!
Reply all
Reply to author
Forward
0 new messages