use of org.activiti.engine.impl.form.StartFormHandler in project Activiti by Activiti.
the class StartEventParseHandler method createStartFormHandlers.
protected void createStartFormHandlers(BpmnParse bpmnParse, StartEvent startEvent, ProcessDefinitionEntity processDefinition) {
if (processDefinition.getInitial() != null) {
if (startEvent.getId().equals(processDefinition.getInitial().getId())) {
StartFormHandler startFormHandler = new DefaultStartFormHandler();
startFormHandler.parseConfiguration(startEvent.getFormProperties(), startEvent.getFormKey(), bpmnParse.getDeployment(), processDefinition);
processDefinition.setStartFormHandler(startFormHandler);
}
}
}
use of org.activiti.engine.impl.form.StartFormHandler in project Activiti by Activiti.
the class GetRenderedStartFormCmd method execute.
public Object execute(CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException("Process Definition '" + processDefinitionId + "' not found", ProcessDefinition.class);
}
StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
if (startFormHandler == null) {
return null;
}
FormEngine formEngine = commandContext.getProcessEngineConfiguration().getFormEngines().get(formEngineName);
if (formEngine == null) {
throw new ActivitiException("No formEngine '" + formEngineName + "' defined process engine configuration");
}
StartFormData startForm = startFormHandler.createStartFormData(processDefinition);
return formEngine.renderStartForm(startForm);
}
use of org.activiti.engine.impl.form.StartFormHandler in project Activiti by Activiti.
the class SubmitStartFormCmd method execute.
protected ProcessInstance execute(CommandContext commandContext, ProcessDefinitionEntity processDefinition) {
ExecutionEntity processInstance = null;
if (businessKey != null) {
processInstance = processDefinition.createProcessInstance(businessKey);
} else {
processInstance = processDefinition.createProcessInstance();
}
commandContext.getHistoryManager().reportFormPropertiesSubmitted(processInstance, properties, null);
StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
startFormHandler.submitFormProperties(properties, processInstance);
processInstance.start();
return processInstance;
}
use of org.activiti.engine.impl.form.StartFormHandler in project Activiti by Activiti.
the class GetStartFormCmd method execute.
public StartFormData execute(CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
}
StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
if (startFormHandler == null) {
throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId + "'");
}
return startFormHandler.createStartFormData(processDefinition);
}
Aggregations