}
Map<String, Object> parameters = new HashMap<String, Object>();
for (Iterator<DataAssociation> iterator = getSubProcessNode().getInAssociations().iterator(); iterator.hasNext(); ) {
DataAssociation mapping = iterator.next();
Object parameterValue = null;
VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getSources().get(0));
if (variableScopeInstance != null) {
parameterValue = variableScopeInstance.getVariable(mapping.getSources().get(0));
} else {
try {
parameterValue = MVEL.eval(mapping.getSources().get(0), new NodeInstanceResolverFactory(this));
} catch (Throwable t) {
System.err.println("Could not find variable scope for variable " + mapping.getSources().get(0));
System.err.println("when trying to execute SubProcess node " + getSubProcessNode().getName());
System.err.println("Continuing without setting parameter.");
}
}
if (parameterValue != null) {
parameters.put(mapping.getTarget(),parameterValue);
}
}
String processId = getSubProcessNode().getProcessId();
// resolve processId if necessary
Map<String, String> replacements = new HashMap<String, String>();
Matcher matcher = PARAMETER_MATCHER.matcher(processId);
while (matcher.find()) {
String paramName = matcher.group(1);
if (replacements.get(paramName) == null) {
VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
resolveContextInstance(VariableScope.VARIABLE_SCOPE, paramName);
if (variableScopeInstance != null) {
Object variableValue = variableScopeInstance.getVariable(paramName);
String variableValueString = variableValue == null ? "" : variableValue.toString();
replacements.put(paramName, variableValueString);
} else {
try {
Object variableValue = MVEL.eval(paramName, new NodeInstanceResolverFactory(this));