From e027acf0cbdb7c1a85aaee4e913c5dcdbbae0b4d Mon Sep 17 00:00:00 2001 From: Martin Weiler Date: Wed, 6 Dec 2023 11:45:58 -0700 Subject: [PATCH] [private-bamoe-issues#1326] Avoid duplicate timer execution with long running timers and async nodes --- .../core/timer/impl/GlobalTimerService.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java index 2c013940f3..53bf42f823 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java @@ -372,6 +372,25 @@ public String getUuid() { return null; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (int) (this.getId() ^ (this.getId() >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if ( this == obj ) return true; + if ( obj == null ) return false; + if ( getClass() != obj.getClass() ) return false; + final DefaultJobHandle other = (DefaultJobHandle) obj; + if (this.getId() != other.getId()) + return false; + return true; + } + } public static class DisposableCommandService implements InternalLocalRunner {