public void signal(final ActivityExecution execution, final String signalName, final Object signalData) throws Exception {
ProcessApplicationReference targetProcessApplication = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity) execution);
if(!ProcessApplicationContextUtil.requiresContextSwitch(targetProcessApplication)) {
ActivityBehavior activityBehaviorInstance = getActivityBehaviorInstance(execution);
if (activityBehaviorInstance instanceof SignallableActivityBehavior) {
((SignallableActivityBehavior) activityBehaviorInstance).signal(execution, signalName, signalData);
} else {
throw new ProcessEngineException("signal() can only be called on a " + SignallableActivityBehavior.class.getName() + " instance");