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));
        }
Exemple #2
0
        public static void InitFormPropertiesOnScope(IVariableMap variables, IActivityExecution execution)
        {
            ProcessDefinitionEntity pd = (ProcessDefinitionEntity)((PvmExecutionImpl)execution).ProcessDefinition;
            IStartFormHandler       startFormHandler = pd.StartFormHandler;

            startFormHandler.SubmitFormVariables(variables, execution);
        }
Exemple #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));
        }
Exemple #4
0
 public CreateStartFormInvocation(IStartFormHandler startFormHandler, ProcessDefinitionEntity definition)
     : base(null, (IResourceDefinitionEntity)definition)
 {
     this.StartFormHandler = startFormHandler;
     this.Definition       = definition;
 }
Exemple #5
0
 public DelegateStartFormHandler(IStartFormHandler formHandler, DeploymentEntity deployment)
     : base(formHandler, deployment.Id)
 {
 }