Rules are not executed when process is executed in business-central
Issue
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
Environment
- Red Hat JBoss BPM Suite
- 6.3.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.