public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
signal((ExecutionImpl)execution, signalName, parameters);
}
public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
ExecutionImpl executionImpl = (ExecutionImpl) execution;
ExecutionImpl subProcessInstance = executionImpl.getSubProcessInstance();
String transitionName = null;
ExecutionContext originalExecutionContext = null;
ExecutionContext subProcessExecutionContext = null;
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
originalExecutionContext = (ExecutionContext) environment.removeContext(Context.CONTEXTNAME_EXECUTION);
subProcessExecutionContext = new ExecutionContext((ExecutionImpl) subProcessInstance);
environment.setContext(subProcessExecutionContext);
}
try {
subProcessInstance.setSuperProcessExecution(null);
executionImpl.setSubProcessInstance(null);
for (SubProcessOutParameterImpl outParameter: outParameters) {
outParameter.consume(executionImpl, subProcessInstance);
}
Activity activity = execution.getActivity();
String subProcessActivityName = subProcessInstance.getActivityName();
if (outcomeExpression!=null) {
ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
Object value = scriptManager.evaluateExpression(outcomeExpression, null);
// if the value is a String and matches the name of an outgoing transition