private void Run() { PendingActServiceConfigurationElement pendingActServiceParam = PendingActServiceSettings.GetConfig().PendingActServices[this.Params.Name]; pendingActServiceParam.NullCheck(string.Format("pendingActServiceConfig配置节错误,没有找到线程{0}对应的节点.", this.Params.Name)); WfPendingActivityInfoCollection pendingActs = LoadPendingActs(pendingActServiceParam.ApplicationName, pendingActServiceParam.ProgramName); if (pendingActs.Count > 0) { Thread.CurrentPrincipal = new DeluxePrincipal(new DeluxeIdentity(pendingActServiceParam.Operator)); //WfActivity中CanMoveTo没有判断StartTime。我希望在workflowSettings加开关,是否使用它。 foreach (var pendingAct in pendingActs) { try { WfRuntime.ProcessPendingActivity(pendingAct); } catch (System.Exception ex) { this.Params.Log.Write(ex); } finally { WfRuntime.ClearCache(); } } } }
public static PendingActServiceSettings GetConfig() { PendingActServiceSettings result = (PendingActServiceSettings)ConfigurationBroker.GetSection("pendingActServiceConfig"); if (result == null) { result = new PendingActServiceSettings(); } return(result); }