Example #1
0
        protected internal virtual void checkAuthorization(CorrelationHandlerResult correlation)
        {
            CommandContext commandContext = Context.CommandContext;

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                if (MessageCorrelationResultType.Execution.Equals(correlation.ResultType))
                {
                    ExecutionEntity execution = correlation.ExecutionEntity;
                    checker.checkUpdateProcessInstanceById(execution.ProcessInstanceId);
                }
                else
                {
                    ProcessDefinitionEntity definition = correlation.ProcessDefinitionEntity;

                    checker.checkCreateProcessInstance(definition);
                }
            }
        }
Example #2
0
        protected internal virtual ProcessInstance instantiateProcess(CommandContext commandContext, CorrelationHandlerResult correlationResult)
        {
            ProcessDefinitionEntity processDefinitionEntity = correlationResult.ProcessDefinitionEntity;

            ActivityImpl    messageStartEvent = processDefinitionEntity.findActivity(correlationResult.StartEventActivityId);
            ExecutionEntity processInstance   = processDefinitionEntity.createProcessInstance(builder.BusinessKey, messageStartEvent);

            if (variablesEnabled)
            {
                variablesListener = new ExecutionVariableSnapshotObserver(processInstance, false, deserializeVariableValues);
            }

            processInstance.VariablesLocal = builder.PayloadProcessInstanceVariablesLocal;

            processInstance.start(builder.PayloadProcessInstanceVariables);

            return(processInstance);
        }
Example #3
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity findProcessInstanceExecution(final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext, final org.camunda.bpm.engine.impl.runtime.CorrelationHandlerResult handlerResult)
        protected internal virtual ExecutionEntity findProcessInstanceExecution(CommandContext commandContext, CorrelationHandlerResult handlerResult)
        {
            ExecutionEntity execution = commandContext.ExecutionManager.findExecutionById(handlerResult.Execution.ProcessInstanceId);

            return(execution);
        }
Example #4
0
        protected internal virtual void triggerExecution(CommandContext commandContext, CorrelationHandlerResult correlationResult)
        {
            string executionId = correlationResult.ExecutionEntity.Id;

            MessageEventReceivedCmd command = new MessageEventReceivedCmd(messageName, executionId, builder.PayloadProcessInstanceVariables, builder.PayloadProcessInstanceVariablesLocal, builder.ExclusiveCorrelation);

            command.execute(commandContext);
        }
Example #5
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.engine.impl.runtime.MessageCorrelationResultImpl createMessageCorrelationResult(final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext, final org.camunda.bpm.engine.impl.runtime.CorrelationHandlerResult handlerResult)
        protected internal virtual MessageCorrelationResultImpl createMessageCorrelationResult(CommandContext commandContext, CorrelationHandlerResult handlerResult)
        {
            MessageCorrelationResultImpl resultWithVariables = new MessageCorrelationResultImpl(handlerResult);

            if (MessageCorrelationResultType.Execution.Equals(handlerResult.ResultType))
            {
                ExecutionEntity execution = findProcessInstanceExecution(commandContext, handlerResult);
                if (variablesEnabled && execution != null)
                {
                    variablesListener = new ExecutionVariableSnapshotObserver(execution, false, deserializeVariableValues);
                }
                triggerExecution(commandContext, handlerResult);
            }
            else
            {
                ProcessInstance instance = instantiateProcess(commandContext, handlerResult);
                resultWithVariables.ProcessInstance = instance;
            }

            if (variablesListener != null)
            {
                resultWithVariables.Variables = variablesListener.Variables;
            }

            return(resultWithVariables);
        }