throws ModelException, SCXMLExpressionException {
// Send attributes evaluation
TransitionTarget parentTarget = getParentTransitionTarget();
Context ctx = scInstance.getContext(parentTarget);
ctx.setLocal(getNamespacesKey(), getNamespaces());
Evaluator eval = scInstance.getEvaluator();
// Most attributes of <send> are expressions so need to be
// evaluated before the EventDispatcher callback
Object hintsValue = null;
if (!SCXMLHelper.isStringEmpty(hints)) {
hintsValue = eval.eval(ctx, hints);
}
String targetValue = target;
if (!SCXMLHelper.isStringEmpty(target)) {
targetValue = (String) eval.eval(ctx, target);
if (SCXMLHelper.isStringEmpty(targetValue)
&& appLog.isWarnEnabled()) {
appLog.warn("<send>: target expression \"" + target
+ "\" evaluated to null or empty String");
}
}
String targettypeValue = targettype;
if (!SCXMLHelper.isStringEmpty(targettype)) {
targettypeValue = (String) eval.eval(ctx, targettype);
if (SCXMLHelper.isStringEmpty(targettypeValue)
&& appLog.isWarnEnabled()) {
appLog.warn("<send>: targettype expression \"" + targettype
+ "\" evaluated to null or empty String");
}
} else {
// must default to 'scxml' when unspecified
targettypeValue = TARGETTYPE_SCXML;
}
Map params = null;
if (!SCXMLHelper.isStringEmpty(namelist)) {
StringTokenizer tkn = new StringTokenizer(namelist);
params = new HashMap(tkn.countTokens());
while (tkn.hasMoreTokens()) {
String varName = tkn.nextToken();
Object varObj = ctx.get(varName);
if (varObj == null) {
//considered as a warning here
errRep.onError(ErrorConstants.UNDEFINED_VARIABLE,
varName + " = null", parentTarget);
}
params.put(varName, varObj);
}
}
long wait = 0L;
if (!SCXMLHelper.isStringEmpty(delay)) {
Object delayValue = eval.eval(ctx, delay);
if (delayValue != null) {
String delayString = delayValue.toString();
wait = parseDelay(delayString, appLog);
}
}
String eventValue = event;
if (!SCXMLHelper.isStringEmpty(event)) {
eventValue = (String) eval.eval(ctx, event);
if (SCXMLHelper.isStringEmpty(eventValue)
&& appLog.isWarnEnabled()) {
appLog.warn("<send>: event expression \"" + event
+ "\" evaluated to null or empty String");
}