protected internal override void UpdateSuspensionState(CommandContext commandContext,
                                                               ISuspensionState suspensionState)
        {
            IProcessDefinitionManager processDefinitionManager = commandContext.ProcessDefinitionManager;

            if (ProcessDefinitionId != null)
            {
                processDefinitionManager.UpdateProcessDefinitionSuspensionStateById(ProcessDefinitionId, suspensionState);
            }
            else if (IsTenantIdSet)
            {
                processDefinitionManager.UpdateProcessDefinitionSuspensionStateByKeyAndTenantId(ProcessDefinitionKey, TenantId, suspensionState);
            }
            else
            {
                processDefinitionManager.UpdateProcessDefinitionSuspensionStateByKey(ProcessDefinitionKey, suspensionState);
            }

            commandContext.RunWithoutAuthorization(() => {
                var jobDefinitionSuspensionStateBuilder = CreateJobDefinitionCommandBuilder();
                var jobDefinitionCmd = GetSetJobDefinitionStateCmd(jobDefinitionSuspensionStateBuilder);
                jobDefinitionCmd.DisableLogUserOperation();
                jobDefinitionCmd.Execute(commandContext);
            });
        }
Exemple #2
0
        protected internal virtual IList <IProcessDefinition> GetDeployedProcesses(DeploymentEntity deployment)
        {
            IList <IProcessDefinition> deployedProcessDefinitions = deployment.DeployedProcessDefinitions;

            if (deployedProcessDefinitions == null)
            {
                // existing deployment
                CommandContext            commandContext = Context.CommandContext;
                IProcessDefinitionManager manager        = commandContext.ProcessDefinitionManager;
                deployedProcessDefinitions = manager.FindProcessDefinitionsByDeploymentId(deployment.Id).Cast <IProcessDefinition>().ToList();
            }

            return(deployedProcessDefinitions);
        }
Exemple #3
0
 public UserOperationLogManager(
     DbContext dbContex,
     IExecutionManager _processInstanceManager,
     IProcessDefinitionManager _processDefinitionManager,
     ILoggerFactory loggerFactory,
     IJobManager _jobManager,
     IJobDefinitionManager _jobDefinitionManager,
     ITaskManager _taskManager
     , IDGenerator idGenerator) : base(dbContex, loggerFactory, idGenerator)
 {
     processInstanceManager   = _processInstanceManager;
     processDefinitionManager = _processDefinitionManager;
     jobManager           = _jobManager;
     jobDefinitionManager = _jobDefinitionManager;
     taskManager          = _taskManager;
 }
Exemple #4
0
 public DeploymentManager(DbContext dbContex,
                          ILoggerFactory loggerFactory,
                          IDGenerator idGenerator,
                          IResourceManager resourceManager,
                          IProcessDefinitionManager processDefinitionManager,
                          IExecutionManager executionManager,
                          IDecisionDefinitionManager decisionDefinitionManager,
                          IHistoricJobLogManager historicJobLogManager,
                          IHistoricDecisionInstanceManager historicDecisionInstanceManager
                          ) : base(dbContex, loggerFactory, idGenerator)
 {
     _resourceManager                 = resourceManager;
     _processDefinitionManager        = processDefinitionManager;
     _executionManager                = executionManager;
     _historicJobLogManager           = historicJobLogManager;
     _decisionDefinitionManager       = decisionDefinitionManager;
     _historicDecisionInstanceManager = historicDecisionInstanceManager;
 }
Exemple #5
0
        protected internal virtual ISet <string> FindDeploymentIdsForProcessDefinitions(CommandContext commandContext,
                                                                                        ISet <string> processDefinitionKeys)
        {
            ISet <string> deploymentsToRegister = new HashSet <string>();

            if (processDefinitionKeys.Count > 0)
            {
                string[] keys = processDefinitionKeys.ToArray();//.toArray(new string[processDefinitionKeys.Count]);
                IProcessDefinitionManager  processDefinitionManager = commandContext.ProcessDefinitionManager;
                IList <IProcessDefinition> previousDefinitions      = processDefinitionManager.FindProcessDefinitionsByKeyIn(keys);

                foreach (IProcessDefinition definition in previousDefinitions)
                {
                    deploymentsToRegister.Add(definition.DeploymentId);
                }
            }
            return(deploymentsToRegister);
        }