java - Else Condition in Drools -
trying implement drools rules project , trying convert lot of if-else
drools rules, not sure how put else
condition in drools. scenario this:
if(value.equals("java.lang.integer")) { //put value pojo } else if(value.equals("java.lang.float")) { } // similar if-else other data type else { //do action (if doesn't satisfy other condition) }
my current content of drl file this:
rule "when method parameter java.lang.integer" when object.getvalue().eqals("java.lang.integer") #set value pojo end rule "when method parameter java.lang.float" when object.getvalue().eqals("java.lang.float") #set value pojo end rule "rules if of above condition fails" # possible have rule else, if # of above condition fails, rule should execute end
now want conditon, should executed if of above condition fails. possible using drools? else part should execute if of above condition fails, tried search , found out drools doesn't support else
conditon. if case how implement type of scenario? can please guide me since beginner drools.
there variations design pattern call "classification". see paper on design patterns, https://engage.redhat.com/forms/rule-design-patterns
since rules - have shown them - syntactically absolutely incorrect, don't want furnish recommendation without knowing needs done - can imagine several options, down couple of rules.
Comments
Post a Comment