Пример #1
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);
            }
        }
Пример #2
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);
        }
Пример #3
0
 protected internal virtual ProcessDefinitionEntity findById(DeploymentCache deploymentCache, string processDefinitionId)
 {
     return(deploymentCache.findDeployedProcessDefinitionById(processDefinitionId));
 }