PathResolver pr = i.getPathResolver();
if (pr != null) {
source = i.getPathResolver().resolvePath(src);
}
String ttype = i.getTargettype();
Invoker inv = null;
try {
inv = scInstance.newInvoker(ttype);
} catch (InvokerException ie) {
TriggerEvent te = new TriggerEvent(s.getId()
+ ".invoke.failed", TriggerEvent.ERROR_EVENT);
internalEvents.add(te);
continue;
}
inv.setParentStateId(s.getId());
inv.setSCInstance(scInstance);
List params = i.params();
Map args = new HashMap();
for (Iterator pIter = params.iterator(); pIter.hasNext();) {
Param p = (Param) pIter.next();
String argExpr = p.getExpr();
Object argValue = null;
ctx.setLocal(NAMESPACES_KEY, p.getNamespaces());
// Do we have an "expr" attribute?
if (argExpr != null && argExpr.trim().length() > 0) {
// Yes, evaluate and store as parameter value
try {
argValue = eval.eval(ctx, argExpr);
} catch (SCXMLExpressionException see) {
errRep.onError(ErrorConstants.EXPRESSION_ERROR,
see.getMessage(), i);
}
} else {
// No. Does value of "name" attribute refer to a valid
// location in the data model?
try {
argValue = eval.evalLocation(ctx, p.getName());
if (argValue == null) {
// Generate error, 4.3.1 in WD-scxml-20080516
TriggerEvent te = new TriggerEvent(s.getId()
+ ERR_ILLEGAL_ALLOC,
TriggerEvent.ERROR_EVENT);
internalEvents.add(te);
}
} catch (SCXMLExpressionException see) {
errRep.onError(ErrorConstants.EXPRESSION_ERROR,
see.getMessage(), i);
}
}
ctx.setLocal(NAMESPACES_KEY, null);
args.put(p.getName(), argValue);
}
try {
inv.invoke(source, args);
} catch (InvokerException ie) {
TriggerEvent te = new TriggerEvent(s.getId()
+ ".invoke.failed", TriggerEvent.ERROR_EVENT);
internalEvents.add(te);
continue;