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;
}
Aggregations