if (keyStr != null && keyStr.trim().toLowerCase().startsWith("expr:")) {
// check for bsh expressions; this does not place values into the context
try {
BshUtil.eval(keyStr.trim().substring(5).trim(), context);
} catch (bsh.EvalError e) {
throw new WfException("Bsh evaluation error.", e);
}
} else if (keyStr != null && keyStr.trim().toLowerCase().startsWith("name:")) {
// name mapping of context values
List couple = StringUtil.split(keyStr.trim().substring(5).trim(), "=");
String mName = (String) couple.get(0); // mapped name
String cName = (String) couple.get(1); // context name
// trim out blank space
if (mName != null) mName = mName.trim();
if (cName != null) cName = cName.trim();
if (mName != null && cName != null && context.containsKey(cName)) {
actualContext.put(mName, context.get(cName));
}
} else if (context.containsKey(key)) {
// direct assignment from context
actualContext.put(key, context.get(key));
} else if (!actualContext.containsKey(key) && !ignoreUnknown) {
throw new WfException("Context does not contain the key: '" + (String) key + "'");
}
}
}
// the serviceSignature should not limit which parameters are in the actualContext