From 1ec71d03258c8165e8b5fb0cb3e1772f228aa310 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Thu, 17 Aug 2023 20:16:44 +0200 Subject: [PATCH] [JBPM-10188] Signaling process instances Original expression needs to be added as it is to external event listeners. This way it can be converted when persisted. --- .../instance/impl/WorkflowProcessInstanceImpl.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java index 9041f24388..4ced5937be 100644 --- a/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java +++ b/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java @@ -622,10 +622,9 @@ protected void registerExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode && "external".equals(((EventNode) node).getScope())) { String eventType = ((EventNode) node).getType(); + addEventListener(eventType, EMPTY_EVENT_LISTENER, true); if (isVariableExpression(eventType)) { addEventListener(resolveVariable(eventType), EMPTY_EVENT_LISTENER, true); - } else { - addEventListener(eventType, EMPTY_EVENT_LISTENER, true); } } else if (node instanceof EventSubProcessNode) { List events = ((EventSubProcessNode) node).getEvents(); @@ -648,10 +647,9 @@ private void unregisterExternalEventNodeListeners() { for (Node node : getWorkflowProcess().getNodes()) { if (node instanceof EventNode && "external".equals(((EventNode) node).getScope())) { String eventType = ((EventNode) node).getType(); + removeEventListener(eventType, EMPTY_EVENT_LISTENER, true); if (isVariableExpression(eventType)) { removeEventListener(resolveVariable(eventType), EMPTY_EVENT_LISTENER, true); - } else { - removeEventListener(eventType, EMPTY_EVENT_LISTENER, true); } } } @@ -909,7 +907,6 @@ private Optional resolveExpressionVariable(String paramName, VariableRes if(factory.isResolveable(paramName)) { return Optional.of(factory.getVariableResolver(paramName).getValue()); } - return Optional.ofNullable(MVELSafeHelper.getEvaluator().eval(paramName, factory)); } catch (Throwable t) { logger.error("Could not find variable scope for variable {}", paramName);