Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-1237

Drools should allow the default target to be specified outside the rule file

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.2.1
    • 3.2.1
    • servicemix-drools
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rgavlin Ron Gavlin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: