Esempio n. 1
0
        public static void initFormPropertiesOnScope(VariableMap variables, PvmExecutionImpl execution)
        {
            ProcessDefinitionEntity pd = (ProcessDefinitionEntity)execution.ProcessDefinition;
            StartFormHandler        startFormHandler = pd.StartFormHandler;

            startFormHandler.submitFormVariables(variables, execution);
        }
Esempio n. 2
0
            public ProcessApplicationReference execute(CommandContext commandContext)
            {
                ProcessDefinitionEntity definition = commandContext.ProcessDefinitionManager.findLatestProcessDefinitionByKey(PROCESS_ID);
                string deploymentId = definition.DeploymentId;
                ProcessApplicationManager processApplicationManager = outerInstance.processEngineConfiguration.ProcessApplicationManager;

                return(processApplicationManager.getProcessApplicationForDeployment(deploymentId));
            }
Esempio n. 3
0
        public static CorrelationHandlerResult matchedProcessDefinition(ProcessDefinitionEntity processDefinitionEntity, string startEventActivityId)
        {
            CorrelationHandlerResult messageCorrelationResult = new CorrelationHandlerResult();

            messageCorrelationResult.processDefinitionEntity = processDefinitionEntity;
            messageCorrelationResult.startEventActivityId    = startEventActivityId;
            messageCorrelationResult.resultType = MessageCorrelationResultType.ProcessDefinition;
            return(messageCorrelationResult);
        }
Esempio n. 4
0
        protected internal virtual ActivityImpl findActivity(ProcessInstance pi, string activityId)
        {
            ProcessInstanceWithVariablesImpl entity           = (ProcessInstanceWithVariablesImpl)pi;
            ProcessDefinitionEntity          processDefEntity = entity.ExecutionEntity.ProcessDefinition;

            assertNotNull(processDefEntity);
            ActivityImpl activity = processDefEntity.findActivity(activityId);

            assertNotNull(activity);
            return(activity);
        }
Esempio n. 5
0
        protected internal override void checkAuthorization(CommandContext commandContext)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;
            DeploymentCache         deploymentCache   = processEngineConfiguration.DeploymentCache;
            ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkReadProcessDefinition(processDefinition);
            }
        }
Esempio n. 6
0
        public virtual StartFormData createStartFormData(ProcessDefinitionEntity processDefinition)
        {
            StartFormDataImpl startFormData = new StartFormDataImpl();

            if (formKey != null)
            {
                startFormData.FormKey = formKey.ExpressionText;
            }
            startFormData.DeploymentId      = deploymentId;
            startFormData.ProcessDefinition = processDefinition;
            initializeFormProperties(startFormData, null);
            initializeFormFields(startFormData, null);
            return(startFormData);
        }
Esempio n. 7
0
        public virtual StartFormData createStartFormData(ProcessDefinitionEntity processDefinition)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;
            IdentityService identityService = processEngineConfiguration.IdentityService;
            RuntimeService  runtimeService  = processEngineConfiguration.RuntimeService;

            logAuthentication(identityService);
            logInstancesCount(runtimeService);

            StartFormDataImpl result = new StartFormDataImpl();

            result.ProcessDefinition = processDefinition;
            return(result);
        }
Esempio n. 8
0
        public virtual string execute(CommandContext commandContext)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration;
            DeploymentCache         deploymentCache   = processEngineConfiguration.DeploymentCache;
            ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);

            foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.checkReadProcessDefinition(processDefinition);
            }

            Expression formKeyExpression = null;

            if (string.ReferenceEquals(taskDefinitionKey, null))
            {
                // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
                FormHandler formHandler = processDefinition.StartFormHandler;

                if (formHandler is DelegateStartFormHandler)
                {
                    DelegateStartFormHandler delegateFormHandler = (DelegateStartFormHandler)formHandler;
                    formHandler = delegateFormHandler.FormHandler;
                }

                // Sorry!!! In case of a custom start form handler (which does not extend
                // the DefaultFormHandler) a formKey would never be returned. So a custom
                // form handler (for a startForm) has always to extend the DefaultStartFormHandler!
                if (formHandler is DefaultStartFormHandler)
                {
                    DefaultStartFormHandler startFormHandler = (DefaultStartFormHandler)formHandler;
                    formKeyExpression = startFormHandler.FormKey;
                }
            }
            else
            {
                TaskDefinition taskDefinition = processDefinition.TaskDefinitions[taskDefinitionKey];
                formKeyExpression = taskDefinition.FormKey;
            }

            string formKey = null;

            if (formKeyExpression != null)
            {
                formKey = formKeyExpression.ExpressionText;
            }
            return(formKey);
        }
Esempio n. 9
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);
        }
Esempio n. 10
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);
                }
            }
        }
Esempio n. 11
0
        public static ConditionHandlerResult matchedProcessDefinition(ProcessDefinitionEntity processDefinition, ActivityImpl startActivityId)
        {
            ConditionHandlerResult conditionHandlerResult = new ConditionHandlerResult(processDefinition, startActivityId);

            return(conditionHandlerResult);
        }
Esempio n. 12
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public org.camunda.bpm.engine.form.StartFormData createStartFormData(final org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity processDefinition)
        public virtual StartFormData createStartFormData(ProcessDefinitionEntity processDefinition)
        {
            return(performContextSwitch(new CallableAnonymousInnerClass(this, processDefinition)));
        }
Esempio n. 13
0
 public ConditionHandlerResult(ProcessDefinitionEntity processDefinition, ActivityImpl activity)
 {
     this.ProcessDefinition = processDefinition;
     this.Activity          = activity;
 }
Esempio n. 14
0
 public virtual void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse)
 {
     // do nothing
 }
Esempio n. 15
0
        protected internal virtual string getProcessDefinitionTenantId(ExecutionEntity execution)
        {
            ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity)execution.getProcessDefinition();

            return(processDefinition.TenantId);
        }
Esempio n. 16
0
 public CreateStartFormInvocation(StartFormHandler startFormHandler, ProcessDefinitionEntity definition) : base(null, definition)
 {
     this.startFormHandler = startFormHandler;
     this.definition       = definition;
 }
Esempio n. 17
0
 public CallableAnonymousInnerClass(DelegateStartFormHandler outerInstance, ProcessDefinitionEntity processDefinition)
 {
     this.outerInstance     = outerInstance;
     this.processDefinition = processDefinition;
 }
Esempio n. 18
0
        public override void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse)
        {
            base.parseConfiguration(activityElement, deployment, processDefinition, bpmnParse);

            ExpressionManager expressionManager = Context.ProcessEngineConfiguration.ExpressionManager;

            string formKeyAttribute = activityElement.attributeNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "formKey");

            if (!string.ReferenceEquals(formKeyAttribute, null))
            {
                this.formKey = expressionManager.createExpression(formKeyAttribute);
            }

            if (formKey != null)
            {
                processDefinition.StartFormKey = true;
            }
        }