protected internal virtual bool IsSymptomOfContextSwitchFailure(System.Exception t, ExecutionEntity contextExecution) { //throw new NotImplementedException(); // a context switch failure can occur, if the current engine has no PA registration for the deployment // subclasses may assert the actual throwable to narrow down the diagnose return(ProcessApplicationContextUtil.GetTargetProcessApplication(contextExecution) == null); }
public virtual object ResolveDelegateClass(IActivityExecution execution) { IProcessApplicationReference targetProcessApplication = ProcessApplicationContextUtil.GetTargetProcessApplication((ExecutionEntity)execution); if (ProcessApplicationContextUtil.RequiresContextSwitch(targetProcessApplication)) { return(Context.ExecuteWithinProcessApplication( () => ResolveDelegateClass(execution), targetProcessApplication, new InvocationContext(execution))); } else { return(InstantiateDelegateClass(execution)); } }
protected internal virtual IProcessApplicationReference GetContextProcessApplication() { if (TaskId != null) { return(ProcessApplicationContextUtil.GetTargetProcessApplication(GetTask())); } if (ExecutionId != null) { return(null); } if (CaseExecutionId != null) { return(null); } return(null); }
// Signallable activity behavior public override void Signal(IActivityExecution execution, string signalName, object signalData) { var targetProcessApplication = ProcessApplicationContextUtil.GetTargetProcessApplication((ExecutionEntity)execution); if (ProcessApplicationContextUtil.RequiresContextSwitch(targetProcessApplication)) { Context.ExecuteWithinProcessApplication <object>(() => { Signal(execution, signalName, signalData); return(null); }, targetProcessApplication, new InvocationContext(execution)); } else { DoSignal(execution, signalName, signalData); } }