Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-44

Rules are not executed when process is executed in business-central

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.0.0.GA
    • 6.x.x
    • Business Central
    • None
    • DR2
    • Hide

      Follow the instructions from the attached reproducer.

      Show
      Follow the instructions from the attached reproducer.

      I have created a process that contains a sequence with a drools condition expression. This is working as expected.

      I then have a business rules task later in the process that has one object as a data input. This object is of type TestObject (included in the attached example) which contains a list of TestObject. The rules that are relevant to the business rules task are as follows:

      rule 'a'
      ruleflow-group 'test-rules'
      when
          $obj : TestObject( $str : strings )
          $s : TestObject() from $str
      then
          System.out.println( "a: " + $s );
      end
      
      rule 'b'
      ruleflow-group 'test-rules'
      when
          $obj : TestObject( $str : strings )
          $s : Object() from $str
      then
          System.out.println( "b: " + $s );
      end
      

      I expect both rules to fire twice (once for each element in the list). However, only the 2nd rule (rule b) fires. This is especially unexpected since the output suggests that $s is in fact of type TestObject. Output:

      15:24:26,445 INFO  [stdout] (http-0.0.0.0:8080-7) found
      15:24:26,448 INFO  [stdout] (http-0.0.0.0:8080-7) b: com.sample.testproject.TestObject@4cc89b3
      15:24:26,448 INFO  [stdout] (http-0.0.0.0:8080-7) b: com.sample.testproject.TestObject@cfdf63b
      

      If the same process is executed outside of business-central, then both rules fire as expected.

      If I remove the sequence with the drools condition (or alternately, change it to be a java condition), both rules fire as expected. Output:

      15:34:29,270 INFO  [stdout] (http-0.0.0.0:8080-9) found
      15:34:29,273 INFO  [stdout] (http-0.0.0.0:8080-9) a: com.sample.testproject.TestObject@13925805
      15:34:29,274 INFO  [stdout] (http-0.0.0.0:8080-9) a: com.sample.testproject.TestObject@6031ace2
      15:34:29,275 INFO  [stdout] (http-0.0.0.0:8080-9) b: com.sample.testproject.TestObject@13925805
      15:34:29,275 INFO  [stdout] (http-0.0.0.0:8080-9) b: com.sample.testproject.TestObject@6031ace2
      

              mfusco@redhat.com Mario Fusco
              rhn-support-mputz Martin Weiler (Inactive)
              Jozef Marko Jozef Marko (Inactive)
              Jozef Marko Jozef Marko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: