Search in sources :

Example 1 with DefaultFormHandler

use of org.activiti.engine.impl.form.DefaultFormHandler in project Activiti by Activiti.

the class GetFormKeyCmd method execute.

public String execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
    DefaultFormHandler formHandler;
    if (taskDefinitionKey == null) {
        // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
        formHandler = (DefaultFormHandler) processDefinition.getStartFormHandler();
    } else {
        TaskDefinition taskDefinition = processDefinition.getTaskDefinitions().get(taskDefinitionKey);
        // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
        formHandler = (DefaultFormHandler) taskDefinition.getTaskFormHandler();
    }
    String formKey = null;
    if (formHandler.getFormKey() != null) {
        formKey = formHandler.getFormKey().getExpressionText();
    }
    return formKey;
}
Also used : DefaultFormHandler(org.activiti.engine.impl.form.DefaultFormHandler) TaskDefinition(org.activiti.engine.impl.task.TaskDefinition) ProcessDefinitionEntity(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)

Aggregations

DefaultFormHandler (org.activiti.engine.impl.form.DefaultFormHandler)1 ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)1 TaskDefinition (org.activiti.engine.impl.task.TaskDefinition)1