I am completely new to Drools and just exploring. So far I had been using a single rule and withing which we use if conditions just like java.
Now I had to use complex rules where I need to use multiple if and else chain but to end it when one in the series of conditions satisfies.
I call the drools from the Apache Camel. The rules should reply back to Camel.
Now How do I do to break the chain of rules and then send response back to the caller which is Camel code when one of if and else condition fails.
1.Can I use multiple end statements to respond back?
2.I can use functions and I know is to write functions in java and import them.
3.Is there any possibility to create functions in Drools and use just like in java?
I am not using the Drools in the way it should be used but so far the rules had not been so complex as the one we are using them now . Any help is is useful for me.
Here is an example which I would like to use please suggest if the below would work or some other alternative like the below.
rule "my rule"
when
#some condition
then
if(){
end
}else if(){
#do something
}
if(){
#do some other logic
}
end
Sample after My second comment
When
object:SomeObject(); // This helps for my camel code to trigger this rule and this rule only
then
if(){
}
else if()
{
return;
}else if() {
}
if(){
}else if(){
return;
}
if(){
}
end