public virtual object Execute(CommandContext commandContext)
        {
            var                     processEngineConfiguration = context.Impl.Context.ProcessEngineConfiguration;
            DeploymentCache         deploymentCache            = processEngineConfiguration.DeploymentCache;
            ProcessDefinitionEntity processDefinition          = deploymentCache.FindDeployedProcessDefinitionById(ProcessDefinitionId);

            EnsureUtil.EnsureNotNull("Process Definition '" + ProcessDefinitionId + "' not found", "processDefinition", processDefinition);

            foreach (var checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.CheckReadProcessDefinition(processDefinition);
            }
            IStartFormHandler startFormHandler = processDefinition.StartFormHandler;

            if (startFormHandler == null)
            {
                return(null);
            }

            var formEngine = context.Impl.Context.ProcessEngineConfiguration.FormEngines[FormEngineName];

            EnsureUtil.EnsureNotNull("No formEngine '" + FormEngineName + "' defined process engine configuration",
                                     "formEngine", formEngine);

            IStartFormData startForm = startFormHandler.CreateStartFormData(processDefinition);

            return(formEngine.RenderStartForm(startForm));
        }
Esempio n. 2
0
        public static void InitFormPropertiesOnScope(IVariableMap variables, IActivityExecution execution)
        {
            ProcessDefinitionEntity pd = (ProcessDefinitionEntity)((PvmExecutionImpl)execution).ProcessDefinition;
            IStartFormHandler       startFormHandler = pd.StartFormHandler;

            startFormHandler.SubmitFormVariables(variables, execution);
        }
Esempio n. 3
0
        public virtual IStartFormData Execute(CommandContext commandContext)
        {
            var                     processEngineConfiguration = context.Impl.Context.ProcessEngineConfiguration;
            DeploymentCache         deploymentCache            = processEngineConfiguration.DeploymentCache;
            ProcessDefinitionEntity processDefinition          = deploymentCache.FindDeployedProcessDefinitionById(ProcessDefinitionId);

            EnsureUtil.EnsureNotNull("No process definition found for id '" + ProcessDefinitionId + "'", "processDefinition", processDefinition);

            foreach (var checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.CheckReadProcessDefinition(processDefinition);
            }

            IStartFormHandler startFormHandler = processDefinition.StartFormHandler;

            EnsureUtil.EnsureNotNull("No startFormHandler defined in process '" + ProcessDefinitionId + "'", "startFormHandler", startFormHandler);

            return(startFormHandler.CreateStartFormData(processDefinition));
        }
Esempio n. 4
0
 public CreateStartFormInvocation(IStartFormHandler startFormHandler, ProcessDefinitionEntity definition)
     : base(null, (IResourceDefinitionEntity)definition)
 {
     this.StartFormHandler = startFormHandler;
     this.Definition       = definition;
 }
Esempio n. 5
0
 public DelegateStartFormHandler(IStartFormHandler formHandler, DeploymentEntity deployment)
     : base(formHandler, deployment.Id)
 {
 }