コード例 #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireJobSuccessfulEvent(final org.camunda.bpm.engine.runtime.Job job)
        public virtual void fireJobSuccessfulEvent(Job job)
        {
            if (isHistoryEventProduced(HistoryEventTypes.JOB_SUCCESS, job))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass3(this, job));
            }
        }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireJobDeletedEvent(final org.camunda.bpm.engine.runtime.Job job)
        public virtual void fireJobDeletedEvent(Job job)
        {
            if (isHistoryEventProduced(HistoryEventTypes.JOB_DELETE, job))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass4(this, job));
            }
        }
コード例 #3
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireExternalTaskDeletedEvent(final org.camunda.bpm.engine.externaltask.ExternalTask externalTask)
        public virtual void fireExternalTaskDeletedEvent(ExternalTask externalTask)
        {
            if (isHistoryEventProduced(HistoryEventTypes.EXTERNAL_TASK_DELETE, externalTask))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass4(this, externalTask));
            }
        }
コード例 #4
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireJobFailedEvent(final org.camunda.bpm.engine.runtime.Job job, final Throwable exception)
        public virtual void fireJobFailedEvent(Job job, Exception exception)
        {
            if (isHistoryEventProduced(HistoryEventTypes.JOB_FAIL, job))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass2(this, job, exception));
            }
        }
コード例 #5
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireExternalTaskSuccessfulEvent(final org.camunda.bpm.engine.externaltask.ExternalTask externalTask)
        public virtual void fireExternalTaskSuccessfulEvent(ExternalTask externalTask)
        {
            if (isHistoryEventProduced(HistoryEventTypes.EXTERNAL_TASK_SUCCESS, externalTask))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass3(this, externalTask));
            }
        }
コード例 #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void fireUserOperationLog(final org.camunda.bpm.engine.impl.oplog.UserOperationLogContext context)
        protected internal virtual void fireUserOperationLog(UserOperationLogContext context)
        {
            if (string.ReferenceEquals(context.UserId, null))
            {
                context.UserId = AuthenticatedUserId;
            }

            HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this, context));
        }
コード例 #7
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void fireHistoricIdentityLinkEvent(final org.camunda.bpm.engine.impl.history.event.HistoryEventType eventType)
        public virtual void fireHistoricIdentityLinkEvent(HistoryEventType eventType)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;

            HistoryLevel historyLevel = processEngineConfiguration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(eventType, this))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this, eventType));
            }
        }
コード例 #8
0
        protected internal virtual void fireFormPropertyHistoryEvents(VariableMap properties, VariableScope variableScope)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl processEngineConfiguration = org.camunda.bpm.engine.impl.context.Context.getProcessEngineConfiguration();
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;
            HistoryLevel historyLevel = processEngineConfiguration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.FORM_PROPERTY_UPDATE, variableScope))
            {
                // fire history events
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity executionEntity;
                ExecutionEntity executionEntity;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String taskId;
                string taskId;
                if (variableScope is ExecutionEntity)
                {
                    executionEntity = (ExecutionEntity)variableScope;
                    taskId          = null;
                }
                else if (variableScope is TaskEntity)
                {
                    TaskEntity task = (TaskEntity)variableScope;
                    executionEntity = task.getExecution();
                    taskId          = task.Id;
                }
                else
                {
                    executionEntity = null;
                    taskId          = null;
                }

                if (executionEntity != null)
                {
                    foreach (String variableName in properties.Keys)
                    {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.variable.value.TypedValue value = properties.getValueTyped(variableName);
                        TypedValue value = properties.getValueTyped(variableName);

                        // NOTE: SerializableValues are never stored as form properties
                        if (!(value is SerializableValue) && value.Value != null && value.Value is String)
                        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String stringValue = (String) value.getValue();
                            string stringValue = (String)value.Value;

                            HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this, executionEntity, taskId, stringValue));
                        }
                    }
                }
            }
        }
コード例 #9
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void completeHistoricBatch(final org.camunda.bpm.engine.impl.batch.BatchEntity batch)
        public virtual void completeHistoricBatch(BatchEntity batch)
        {
            ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration;

            HistoryLevel historyLevel = configuration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_END, batch))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass2(this, batch));
            }
        }
コード例 #10
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void migrateActivityInstanceHistory(final org.camunda.bpm.engine.delegate.DelegateExecution execution)
        protected internal virtual void migrateActivityInstanceHistory(DelegateExecution execution)
        {
            HistoryLevel historyLevel = Context.ProcessEngineConfiguration.HistoryLevel;

            if (!historyLevel.isHistoryEventProduced(HistoryEventTypes.ACTIVITY_INSTANCE_MIGRATE, this))
            {
                return;
            }

            HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass2(this));
        }
コード例 #11
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void createHistoricTask(final TaskEntity task)
        public virtual void createHistoricTask(TaskEntity task)
        {
            ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration;

            HistoryLevel historyLevel = configuration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_CREATE, task))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass3(this, task));
            }
        }
コード例 #12
0
        public virtual void triggerHistoryEvent(IList <ProcessInstance> subProcesslist)
        {
            ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration;
            HistoryLevel historyLevel = configuration.HistoryLevel;

            foreach (ProcessInstance processInstance in subProcesslist)
            {
                // TODO: This smells bad, as the rest of the history is done via the
                // ParseListener
                if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_UPDATE, processInstance))
                {
                    HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this));
                }
            }
        }
コード例 #13
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void markTaskInstanceEnded(String taskId, final String deleteReason)
        public virtual void markTaskInstanceEnded(string taskId, string deleteReason)
        {
            ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final TaskEntity taskEntity = org.camunda.bpm.engine.impl.context.Context.getCommandContext().getDbEntityManager().selectById(TaskEntity.class, taskId);
            TaskEntity taskEntity = Context.CommandContext.DbEntityManager.selectById(typeof(TaskEntity), taskId);

            HistoryLevel historyLevel = configuration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_COMPLETE, taskEntity))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass2(this, deleteReason, taskEntity));
            }
        }
コード例 #14
0
        protected internal override void triggerHistoryEvent(CommandContext commandContext)
        {
            HistoryLevel            historyLevel            = commandContext.ProcessEngineConfiguration.HistoryLevel;
            IList <ProcessInstance> updatedProcessInstances = obtainProcessInstances(commandContext);

            //suspension state is not updated synchronously
            if (NewSuspensionState != null && updatedProcessInstances != null)
            {
                foreach (ProcessInstance processInstance in updatedProcessInstances)
                {
                    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_UPDATE, processInstance))
                    {
                        HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this));
                    }
                }
            }
        }
コード例 #15
0
        public virtual Void execute(CommandContext commandContext)
        {
            ProcessEngineConfigurationImpl configuration = commandContext.ProcessEngineConfiguration;

            // check that the new process definition is just another version of the same
            // process definition that the process instance is using
            ExecutionManager executionManager = commandContext.ExecutionManager;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity processInstance = executionManager.findExecutionById(processInstanceId);
            ExecutionEntity processInstance = executionManager.findExecutionById(processInstanceId);

            if (processInstance == null)
            {
                throw new ProcessEngineException("No process instance found for id = '" + processInstanceId + "'.");
            }
            else if (!processInstance.ProcessInstanceExecution)
            {
                throw new ProcessEngineException("A process instance id is required, but the provided id " + "'" + processInstanceId + "' " + "points to a child execution of process instance " + "'" + processInstance.ProcessInstanceId + "'. " + "Please invoke the " + this.GetType().Name + " with a root execution id.");
            }
            ProcessDefinitionImpl currentProcessDefinitionImpl = processInstance.getProcessDefinition();

            DeploymentCache         deploymentCache = configuration.DeploymentCache;
            ProcessDefinitionEntity currentProcessDefinition;

            if (currentProcessDefinitionImpl is ProcessDefinitionEntity)
            {
                currentProcessDefinition = (ProcessDefinitionEntity)currentProcessDefinitionImpl;
            }
            else
            {
                currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(currentProcessDefinitionImpl.Id);
            }

            ProcessDefinitionEntity newProcessDefinition = deploymentCache.findDeployedProcessDefinitionByKeyVersionAndTenantId(currentProcessDefinition.Key, processDefinitionVersion, currentProcessDefinition.TenantId);

            validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition);

            HistoryLevel historyLevel = configuration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_UPDATE, processInstance))
            {
                HistoryEventProcessor.processHistoryEvents(new HistoryEventCreatorAnonymousInnerClass(this, processInstance));
            }

            // switch all sub-executions of the process instance to the new process definition version
            IList <ExecutionEntity> childExecutions = executionManager.findExecutionsByProcessInstanceId(processInstanceId);

            foreach (ExecutionEntity executionEntity in childExecutions)
            {
                validateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition);
            }

            // switch all jobs to the new process definition version
            IList <JobEntity>           jobs = commandContext.JobManager.findJobsByProcessInstanceId(processInstanceId);
            IList <JobDefinitionEntity> currentJobDefinitions    = commandContext.JobDefinitionManager.findByProcessDefinitionId(currentProcessDefinition.Id);
            IList <JobDefinitionEntity> newVersionJobDefinitions = commandContext.JobDefinitionManager.findByProcessDefinitionId(newProcessDefinition.Id);

            IDictionary <string, string> jobDefinitionMapping = getJobDefinitionMapping(currentJobDefinitions, newVersionJobDefinitions);

            foreach (JobEntity jobEntity in jobs)
            {
                switchVersionOfJob(jobEntity, newProcessDefinition, jobDefinitionMapping);
            }

            // switch all incidents to the new process definition version
            IList <IncidentEntity> incidents = commandContext.IncidentManager.findIncidentsByProcessInstance(processInstanceId);

            foreach (IncidentEntity incidentEntity in incidents)
            {
                switchVersionOfIncident(commandContext, incidentEntity, newProcessDefinition);
            }

            // add an entry to the op log
            PropertyChange change = new PropertyChange("processDefinitionVersion", currentProcessDefinition.Version, processDefinitionVersion);

            commandContext.OperationLogManager.logProcessInstanceOperation(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_MODIFY_PROCESS_INSTANCE, processInstanceId, null, null, Collections.singletonList(change));

            return(null);
        }