Пример #1
0
 public CommonSignConfigurationRootActionIMP(IWorkflowResourceRepository workflowResourceRepository, ICommonSignConfigurationEntryServiceSelector commonSignConfigurationEntryServiceSelector, ICommonSignConfigurationEntryNodeFindServiceSelector commonSignConfigurationEntryNodeFindServiceSelector, ICommonSignConfigurationEntryGetExecuteUsersServiceSelector commonSignConfigurationEntryGetExecuteUsersServiceSelector)
 {
     _workflowResourceRepository = workflowResourceRepository;
     _commonSignConfigurationEntryServiceSelector                = commonSignConfigurationEntryServiceSelector;
     _commonSignConfigurationEntryNodeFindServiceSelector        = commonSignConfigurationEntryNodeFindServiceSelector;
     _commonSignConfigurationEntryGetExecuteUsersServiceSelector = commonSignConfigurationEntryGetExecuteUsersServiceSelector;
 }
Пример #2
0
        /// <summary>
        /// 获取指定的工作流资源
        /// 如果存在,则直接返回
        /// 如果不存在,则新建再返回
        /// </summary>
        /// <param name="type"></param>
        /// <param name="key"></param>
        /// <param name="initStatus"></param>
        /// <returns></returns>
        public static async Task <WorkflowResource> GetWorkflowResource(IWorkflowResourceRepository workflowResourceRepository, string type, string key, int initStatus)
        {
            var resource = await workflowResourceRepository.QueryByKey(type, key);

            if (resource == null)
            {
                resource = new WorkflowResource()
                {
                    Type       = type,
                    Key        = key,
                    InitStatus = initStatus,
                    Status     = initStatus
                };

                try
                {
                    await resource.Add();
                }
                catch (UtilityException ex)
                {
                    if (ex.Code == (int)Errors.ExistWorkflowResourceKey)
                    {
                        resource = await workflowResourceRepository.QueryByKey(type, key);
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            return(resource);
        }
Пример #3
0
 public CommonSignConfigurationIMP(IWorkflowResourceRepository workflowResourceRepository, ICommonSignConfigurationCompleteServiceSelector commonSignConfigurationCompleteServiceSelector, ICommonSignConfigurationNodeStore commonSignConfigurationNodeStore, ICommonSignConfigurationRootActionStore commonSignConfigurationRootActionStore, ICommonSignConfigurationStore commonSignConfigurationStore)
 {
     _workflowResourceRepository = workflowResourceRepository;
     _commonSignConfigurationCompleteServiceSelector = commonSignConfigurationCompleteServiceSelector;
     _commonSignConfigurationNodeStore       = commonSignConfigurationNodeStore;
     _commonSignConfigurationRootActionStore = commonSignConfigurationRootActionStore;
     _commonSignConfigurationStore           = commonSignConfigurationStore;
 }
Пример #4
0
 public CommonSignConfigurationNodeIMP(ICommonSignConfigurationNodeActionStore commonSignConfigurationNodeActionStore, IWorkflowResourceRepository workflowResourceRepository, ICommonSignConfigurationNodeGetExecuteUserServiceSelector commonSignConfigurationNodeGetExecuteUserServiceSelector, ICommonSignConfigurationNodeCreateFlowExecuteServiceSelector commonSignConfigurationNodeCreateFlowExecuteServiceSelector, ICommonSignConfigurationNodeDirectGoExecuteServiceSelector commonSignConfigurationNodeDirectGoExecuteServiceSelector, ICommonSignConfigurationNodeStore commonSignConfigurationNodeStore, IApplicationLockService applicationLockService)
 {
     _commonSignConfigurationNodeActionStore = commonSignConfigurationNodeActionStore;
     _workflowResourceRepository             = workflowResourceRepository;
     _commonSignConfigurationNodeGetExecuteUserServiceSelector    = commonSignConfigurationNodeGetExecuteUserServiceSelector;
     _commonSignConfigurationNodeCreateFlowExecuteServiceSelector = commonSignConfigurationNodeCreateFlowExecuteServiceSelector;
     _commonSignConfigurationNodeDirectGoExecuteServiceSelector   = commonSignConfigurationNodeDirectGoExecuteServiceSelector;
     _commonSignConfigurationNodeStore = commonSignConfigurationNodeStore;
     _applicationLockService           = applicationLockService;
 }