Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-7552

Rules not fired when mapping WIH output to caseFile data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 7.8.0.Final
    • None
    • Runtime Engine
    • None
    • NEW
    • NEW
    • Hide

      1) Import the following repo in BC and deploy: https://github.com/DuncanDoyle/test-case-wih-io-rules.git
      2) Start a new case (for example through REST API or "rhpam-case-mgmt-showcase" app).
      3) Complete the userTask (assigned to "pamadmin" user). Observe that the milestone gets fired and completed, but the rule does not. (this to me shows the the Output mapping to the caseFile_test variable does not fire the rules).
      4) Start a new case.
      5) Set the "caseFile_test" variable to a random String. Observe that the milestone completes, but the rules don't fire.
      6) Start a new case.
      7) Use the RESTful API to set the "caseFile_test" variable to a random String. Observe that the milestone completes AND the rules fire.

      Show
      1) Import the following repo in BC and deploy: https://github.com/DuncanDoyle/test-case-wih-io-rules.git 2) Start a new case (for example through REST API or "rhpam-case-mgmt-showcase" app). 3) Complete the userTask (assigned to "pamadmin" user). Observe that the milestone gets fired and completed, but the rule does not. (this to me shows the the Output mapping to the caseFile_test variable does not fire the rules). 4) Start a new case. 5) Set the "caseFile_test" variable to a random String. Observe that the milestone completes, but the rules don't fire. 6) Start a new case. 7) Use the RESTful API to set the "caseFile_test" variable to a random String. Observe that the milestone completes AND the rules fire.

    Description

      Rules that operate on case-data should fire whenever the case-data changes. E.g.

      • When the data is changed in the Business Central UI
      • When a WIH I/O maps it output onto a caseFile variable,

      Atm, jBPM only triggers rules/Conditions that are set on, for example, Milestones in the above cases. Rules defined in a DRL are NOT evaluated.

      The rules are evaluated when setting the caseFile data through the CaseService (putCaseInstanceData).

      IMO, rules defined in DRLs should always fire whenever the caseData that they operate on changes.

      Reproducer project here: https://github.com/DuncanDoyle/test-case-wih-io-rules.git

      Note that the reason the rules don't fire when updating the caseFile variable through the workbench is probably because the workbench is using the "/kie-server/services/rest/server/containers/test-case-wih-io-rules_1.0.0-SNAPSHOT/processes/instances/13/variable/caseFile_test" REST API, and not through the CaseService .... However, the Milestone still DOES fire in that case.

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            rhn-gps-ddoyle Duncan Doyle (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: