Skip to content

Commit

Permalink
[JBPM-10188] Signaling process instances
Browse files Browse the repository at this point in the history
Original expression needs to be added as it is to external event
listeners. This way it can be converted when persisted.
  • Loading branch information
fjtirado committed Aug 17, 2023
1 parent 829c59f commit 1ec71d0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> events = ((EventSubProcessNode) node).getEvents();
Expand All @@ -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);
}
}
}
Expand Down Expand Up @@ -909,7 +907,6 @@ private Optional<Object> 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);
Expand Down

0 comments on commit 1ec71d0

Please sign in to comment.