I would like to using drools in our project, but i realy hope to write rules
simply in Java, not in drl language, nor python/javascript because java is
the familar language to our team.
consider the following case:
class OrderCancelAction {
public boolean checkPreCondition(Order order){
// return true to identify that the order can be canceled.
}
public void execute(Order order){
// cancel the order here
}
}
I would like to map the checkPreCondition as an drools Condition, and maps
execute as an Consquence, since checkPreCondition may looks like
order.status == 1 && order.address != null && conditionOther
So it may be a good choice to split the Condtion to more child Condition
like:
order.status == 1
order.address != null
otherCondition
and we can chain the condition between more rules.
And i have do a prototype tring on drools based on ByteCode analysis, How
does anybody think about this issue?