I am new to Drools. As per my usecase, I want to dynamically create the rules. I have considered using the following rule template:
template header
rule
eventType
package org.ossandme;
global org.ossandme.AlertDecision alertDecision;
template "alert"
rule "alert_@{row.rowNumber}"
when
@{eventType}(@{rule})
then
alertDecision.setDoAlert(Boolean.TRUE);
end
end template
But the problem with this template is that it fixes the number of conditions and actions (1 in this case). According to my use case, I might have different number of conditions and actions in different rules. Is it possible to create a generic template which can create rules, with different number of conditions and different number of actions in each rule?