class BPMNFormModelGeneratorImpl implements BPMNFormModelGenerator {

    @Override
    public List<TaskFormModel> generateTaskFormModels(Definitions source,
                                                      Path path) {

        Process process = getProcess(source);

        final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path));

        if (process != null) {
            ProcessTaskFormsGenerationResult result = readUserTaskFormVariables(process);
            return result.getAllTaskFormVariables().stream().filter(taskFormVariables -> {
                if (!taskFormVariables.isValid()) {
                    logger.warn(generateErrorMessage(taskFormVariables));
                    return false;
                }
                return true;
            }).map(taskFormVariables -> taskFormVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)))
                    .collect(Collectors.toList());
        }
        return Collections.emptyList();
    }

    @Inject public  BPMNFormModelGeneratorImpl(KieModuleService moduleService,
                                      ModuleClassLoaderHelper projectClassLoaderHelper);

}