Bug 1213209
| Summary: | Duplicate Timer calls by a Boundary Timer inside a MultipleInstances | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Toshiya Kobayashi <tkobayas> | ||||
| Component: | jBPM Core | Assignee: | Shelly McGowan <smcgowan> | ||||
| Status: | CLOSED EOL | QA Contact: | Radovan Synek <rsynek> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.1.0 | CC: | mbaluch | ||||
| Target Milestone: | DR1 | ||||||
| Target Release: | 6.2.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1226107 (view as bug list) | Environment: | |||||
| Last Closed: | 2020-03-27 20:03:40 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: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1226107 | ||||||
| Attachments: |
|
||||||
|
Description
Toshiya Kobayashi
2015-04-20 03:32:50 UTC
Created attachment 1016219 [details]
BPMN2-BoundaryTimerInMultipleInstances.bpmn2.workaround
Attached a process which tries suppress the duplicate calls. A problem is that it would be cumbersome when we have many Timer+Notification pairs in a process so needs to have a unique 'key' for each Notification.
===============================
[Prepare]
java.util.Map map = new java.util.HashMap();
kcontext.setVariable("notificationMap", map);
...
[Email Notification]
// Suppress duplicate calls
java.util.Map map = (java.util.Map)kcontext.getVariable("notificationMap");
String key = "EmailNotificationForTask1-" + kcontext.getVariable("actorName");
Object value = map.get(key);
long current = System.currentTimeMillis();
if (value != null) {
long lastNotification = Long.parseLong((String)value);
if ((current - lastNotification) < 1000) {
// do nothing
return;
}
}
map.put(key, String.valueOf(current));
kcontext.setVariable("notificationMap", map);
// Send an email
...
Note: this workaround just suppresses duplicate calls in the Script Task so it doesn't solve the assert failure of the test case GlobalTimerServiceBaseTest.testTimerInMultipleInstances() because it counts ProcessEventListener.afterNodeLeft() of "timer", which is still actually fired even with the workaround. Marco Rietveld <marco.rietveld> updated the status of jira JBPM-4611 to Resolved Fixed on master: https://github.com/droolsjbpm/jbpm/commit/eccfb4f8 https://github.com/droolsjbpm/jbpm/commit/486103f4 Leaving this as assigned since the BZ is for 6.2 and could be included in a future roll-up? Verified on BPMS 6.2.0 ER5 https://github.com/droolsjbpm/jbpm/pull/327 |