Skip to content

Commit

Permalink
[JBPM-10188] Signaling process instances (#2319) (#2325)
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.

Co-authored-by: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and fjtirado authored Sep 7, 2023
1 parent a00af71 commit 543218f
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 543218f

Please sign in to comment.