Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.2.1
-
None
Description
Drools should allow the default target to be specified outside the rule file. This allows common rule sets to be reused across different process flows.
A common use case for this requirement is using Drools as a semantic validator. In this case, each rule in the rule set generates a fault if it is satisfied. If no rule is satisfied, the message is considered valid and forwarded to the externally-supplied default target. The rule file used to implement this semantic validator can be re-used across many process flows.
When implementing a semantic validator as described above, it would also be useful for each rule to optionally forward "fault content" to the default target instead of generating a JBI fault. In this case, the default target would be responsible for distinguishing between fault and non-fault content and handling it appropriately. A convenience method added to the JbiHelper, such as faultToDefaultTarget(), would significantly help a rule writer implement such functionality.
I intend to submit a patch for this issue in the near future.