in src/main/java/org/apache/commons/scxml2/semantics/SCXMLSemanticsImpl.java [885:919]
public void processInvokes(final SCXMLExecutionContext exctx, final TriggerEvent event) throws ModelException {
for (final Map.Entry<Invoke, String> entry : exctx.getInvokeIds().entrySet()) {
if (entry.getValue().equals(event.getInvokeId())) {
final Invoke invoke = entry.getKey();
final Finalize finalize = invoke.getFinalize();
if (finalize != null) {
if (finalize.getActions().isEmpty()) {
/*
The current https://www.w3.org/TR/2015/REC-scxml-20150901/#finalize specification for
using an empty <finalize/> (no actions) is rather complex when:
- the invoke also has a namelist attribute and/or params with a location attribute
- and the event payload has values reachable by those namelist and/or params 'location' attributes
then the statemachine data at those locations should be updated with the payload values.
As the same functionality can be achieved (even if less convenient) by using a <finalize>
with <assign/> elements for each of these locations, *and* there are no SCXML IRP tests
for using an empty <finalize/>, the above logic is NOT implemented.
*/
} else {
executeContent(exctx, finalize);
}
}
if (entry.getKey().isAutoForward() &&
!(event.getName().equals("done.invoke."+entry.getValue()) ||
event.getName().startsWith("done.invoke."+entry.getValue()+"."))) {
try {
exctx.getInvoker(entry.getKey()).parentEvent(event);
} catch (final InvokerException ie) {
exctx.getAppLog().error(ie.getMessage(), ie);
throw new ModelException(ie.getMessage(), ie.getCause());
}
}
}
}
}