Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1134278

Summary: Boundary Event associated to a User Task is listening for the signal even when the User Task is not active
Product: [Retired] JBoss BPMS Platform 6 Reporter: Musharraf Hussain <mhussain>
Component: jBPM CoreAssignee: Alessandro Lazarotti <alazarot>
Status: CLOSED EOL QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.2CC: mbaluch, smcgowan
Target Milestone: DR3   
Target Release: 6.1.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:04:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
BuggySignallingOnBoundaryEvent.zip none

Description Musharraf Hussain 2014-08-27 08:18:46 UTC
Description of problem:
- It has been observed that Boundary Event associated to a User Task is listening for the signal even when the User Task is not active. To prove this behavior I have attached a sample jBPM6 Project which can be imported in JBDS or any Eclipse based IDE and execute the "ProcessMain.java" class to reproduce the problem.
- I have a process which has the following sequence of flows.
~~~
Start -> Signal -> XOR gateway (Converging) -> Script Task -> User task 
(having a Boundary Event) -> End

 User task (having a Boundary Event) -> XOR gateway (Converging) -> Script Task -> User task (having a Boundary Event) -> End
~~~
As it can be seen from above flows there are two signal events and they both use the same SignalRef "SignalOne" , and when the process is instantiated it waits for signal to continue moving forward. Now, the problem is that when the process instance is signalled , it is observed that the script task is executed 
twice. Note that the Boundary Event attached to the User Task redirects 
the process flow the the XOR gateway again when it is signalled.
- Ideally, a boundary event should only be active when the node (it is attached
to) is active. Hence, it appears to be a buggy behavior.

Version-Release number of selected component (if applicable):
- BPMS 6.0.2

How reproducible:
- Use the attached "BuggySignallingOnBoundaryEvent.zip" JBDS project to reproduce the issue.

Steps to Reproduce:
1. Import the attached "BuggySignallingOnBoundaryEvent.zip" project in JBDS or any Eclipse based IDE and try to resolve the dependencies if required.
2. The process definition should already be packaged in the Jar "jbpm-example-1.0.0-20140827.062224-2.jar" which has been included in the Build Path. So, just go ahead and execute the "ProcessMain.java" class to reproduce the problem.

Actual results:
- It should print the SYSOUT statement from the script task twice like this. Which should not happen. 
~~~
######### STARTING PROCESS INSTANCE #########
######### PROCESS STARTED NOW SIGNALLING IT #########
This script has been FIRED from the 'STask1' Script Task... 
This script has been FIRED from the 'STask1' Script Task... 
######### PROCESS HAS BEEN SIGNALED #########

~~~

It is happening because the Boundary Event attached to the User Task is also listening to the same Signal which is being listened by the first Intermediate Signal Event in the process definition. That is the reason why the process flow moves again into the XOR gateway from the User Task and the Script Task is again executed.


Expected results:
- The Boundary Event attached to the User Task should not be listening to the Event at this moment.

Additional info:
- Not Applicable.

Comment 2 Musharraf Hussain 2014-08-27 08:20:51 UTC
Created attachment 931336 [details]
BuggySignallingOnBoundaryEvent.zip

BuggySignallingOnBoundaryEvent.zip

Comment 3 Maciej Swiderski 2014-08-29 15:30:39 UTC
fix provided to master to avoid signaling boundary event for activities that were created as part of ongoing signal

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/af5972b35e129291fb037b32c144466695698ff8

Comment 4 Jiri Svitak 2014-09-25 15:44:19 UTC
Verified in BPMS 6.1.0.DR3.

Regression test has been added:
https://gitlab.mw.lab.eng.bos.redhat.com/bxms/brms/commit/c64cec05f30f42fbad27ae077e15fa2093b1c7ea