return new String[] { "processInstanceCompleted:" + processInstanceId };
}
public void processInstanceCompleted(ProcessInstance processInstance) {
removeEventListeners();
VariableScopeInstance subProcessVariableScopeInstance = (VariableScopeInstance)
processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);
for (Map.Entry<String, String> mapping: getSubProcessNode().getOutMappings().entrySet()) {
VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getValue());
if (variableScopeInstance != null) {
Object value = subProcessVariableScopeInstance.getVariable(mapping.getKey());
if (value == null) {
try {
value = MVEL.eval(mapping.getKey(), new VariableScopeResolverFactory(subProcessVariableScopeInstance));
} catch (Throwable t) {
// do nothing
}
}
variableScopeInstance.setVariable(mapping.getValue(), value);
} else {
System.err.println("Could not find variable scope for variable " + mapping.getValue());
System.err.println("when trying to complete SubProcess node " + getSubProcessNode().getName());
System.err.println("Continuing without setting variable.");
}