in src/main/java/org/apache/commons/scxml2/semantics/SCXMLSemanticsImpl.java [733:774]
public boolean matchTransition(final SCXMLExecutionContext exctx, final Transition transition, final String eventName) {
if (eventName != null) {
if (!(transition.isNoEventsTransition() || transition.isAllEventsTransition())) {
boolean eventMatch = false;
for (final String event : transition.getEvents()) {
if (eventName.startsWith(event) && (eventName.length() == event.length() || eventName.charAt(event.length())=='.')) {
eventMatch = true;
break;
}
}
if (!eventMatch) {
return false;
}
}
else if (!transition.isAllEventsTransition()) {
return false;
}
}
else if (!transition.isNoEventsTransition()) {
return false;
}
if (transition.getCond() != null) {
Boolean result = Boolean.FALSE;
final Context context = exctx.getScInstance().getContext(transition.getParent());
try {
if ((result = exctx.getEvaluator().evalCond(context, transition.getCond())) == null) {
result = Boolean.FALSE;
if (exctx.getAppLog().isDebugEnabled()) {
exctx.getAppLog().debug("Treating as false because the cond expression was evaluated as null: '"
+ transition.getCond() + "'");
}
}
}
catch (final SCXMLExpressionException e) {
exctx.getInternalIOProcessor().addEvent(new EventBuilder(TriggerEvent.ERROR_EXECUTION, TriggerEvent.ERROR_EVENT).build());
exctx.getErrorReporter().onError(ErrorConstants.EXPRESSION_ERROR, "Treating as false due to error: "
+ e.getMessage(), transition);
}
return result;
}
return true;
}