public static IDisposable Scope(WorkflowActivityInfo wa) { var old = Current; CurrentVariable.Value = wa; return(new Disposable(() => CurrentVariable.Value = old)); }
public EntityPackWorkflow GetEntity(string caseActivityId) { var lite = Lite.ParsePrimaryKey <CaseActivityEntity>(caseActivityId); var activity = CaseActivityLogic.RetrieveForViewing(lite); using (WorkflowActivityInfo.Scope(new WorkflowActivityInfo { CaseActivity = activity })) { var ep = SignumServer.GetEntityPack((Entity)activity.Case.MainEntity); return(new EntityPackWorkflow { activity = activity, canExecuteActivity = OperationLogic.ServiceCanExecute(activity).ToDictionary(a => a.Key.Key, a => a.Value), canExecuteMainEntity = ep.canExecute, Extension = ep.extension, }); } }