use of org.kie.workbench.common.forms.jbpm.server.service.formGeneration.impl.GenerationContext in project kie-wb-common by kiegroup.
the class BPMNVFSFormDefinitionGeneratorService method findFormDefinitionForModelType.
@Override
protected FormDefinition findFormDefinitionForModelType(String modelType, GenerationContext<Path> context) {
FormDefinition form = super.findFormDefinitionForModelType(modelType, context);
if (form != null) {
return form;
}
List<FormDefinition> foundForms = formFinderService.findFormsForType(modelType, context.getSource());
Optional<FormDefinition> validForm = foundForms.stream().filter(formDefinition -> !formDefinition.getFields().isEmpty()).findFirst();
return validForm.orElse(foundForms.stream().findFirst().orElse(null));
}
Aggregations