@Test public void testCorrectTaskFormModelIsGeneratedForTaskWithoutAnyInputsOrOutputsInSwimlane() { final String TASK_ID = "_23BBA464-615A-405F-8C3B-4F643BE522D6", TASK_NAME = "emptyTask"; TaskFormModel taskFormModel = generator.generateTaskFormModel(processWithAllVariablesDefinitions, TASK_ID, path); assertTaskFormModelIsCorrect(taskFormModel, PROCESS_WITH_ALL_VARIABLES_ID, TASK_NAME); assertTrue(taskFormModel.getProperties().isEmpty()); }
@Override public TaskFormModel generateTaskFormModel(Definitions source, String taskId, Path path) { Process process = getProcess(source); if (process != null) { ProcessTaskFormsGenerationResult generationResult = readUserTaskFormVariables(process); Optional<TaskFormVariables> resultTaskFormVariables = Optional.ofNullable(generationResult.getTaskFormVariablesByTaskId(taskId)); if (resultTaskFormVariables.isPresent()) { TaskFormVariables formVariables = resultTaskFormVariables.get(); if (!formVariables.isValid()) { throw new IllegalStateException(generateErrorMessage(formVariables)); } final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); return formVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)); } } return null; }
BPMNFormModelGeneratorImpl implements BPMNFormModelGenerator { @Override public TaskFormModel generateTaskFormModel(Definitions source, String taskId, Path path) { Process process = getProcess(source); if (process != null) { ProcessTaskFormsGenerationResult generationResult = readUserTaskFormVariables(process); Optional<TaskFormVariables> resultTaskFormVariables = Optional.ofNullable(generationResult.getTaskFormVariablesByTaskId(taskId)); if (resultTaskFormVariables.isPresent()) { TaskFormVariables formVariables = resultTaskFormVariables.get(); if (!formVariables.isValid()) { throw new IllegalStateException(generateErrorMessage(formVariables)); } final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); return formVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)); } } return null; } }
BPMNFormModelGeneratorImpl implements BPMNFormModelGenerator { @Override public TaskFormModel generateTaskFormModel(Definitions source, String taskId, Path path) { Process process = getProcess(source); if (process != null) { ProcessTaskFormsGenerationResult generationResult = readUserTaskFormVariables(process); Optional<TaskFormVariables> resultTaskFormVariables = Optional.ofNullable(generationResult.getTaskFormVariablesByTaskId(taskId)); if (resultTaskFormVariables.isPresent()) { TaskFormVariables formVariables = resultTaskFormVariables.get(); if (!formVariables.isValid()) { throw new IllegalStateException(generateErrorMessage(formVariables)); } final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); return formVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)); } } return null; } @Inject  BPMNFormModelGeneratorImpl(KieModuleService moduleService,
                                      ModuleClassLoaderHelper projectClassLoaderHelper); }
BPMNFormModelGeneratorImpl implements BPMNFormModelGenerator { @Override public TaskFormModel generateTaskFormModel(Definitions source, String taskId, Path path) { Process process = getProcess(source); if (process != null) { ProcessTaskFormsGenerationResult generationResult = readUserTaskFormVariables(process); Optional<TaskFormVariables> resultTaskFormVariables = Optional.ofNullable(generationResult.getTaskFormVariablesByTaskId(taskId)); if (resultTaskFormVariables.isPresent()) { TaskFormVariables formVariables = resultTaskFormVariables.get(); if (!formVariables.isValid()) { throw new IllegalStateException(generateErrorMessage(formVariables)); } final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); return formVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)); } } return null; } @Inject  BPMNFormModelGeneratorImpl(KieModuleService moduleService,
                                      ModuleClassLoaderHelper projectClassLoaderHelper); @Override BusinessProcessFormModel generateProcessFormModel(Definitions source,
                                                             Path path); @Override List<TaskFormModel> generateTaskFormModels(Definitions source,
                                                      Path path); @Override TaskFormModel generateTaskFormModel(Definitions source,
                                               String taskId,
                                               Path path); @Override Process getProcess(Definitions source); }
BPMNFormModelGeneratorImpl implements BPMNFormModelGenerator { @Override public TaskFormModel generateTaskFormModel(Definitions source, String taskId, Path path) { Process process = getProcess(source); if (process != null) { ProcessTaskFormsGenerationResult generationResult = readUserTaskFormVariables(process); Optional<TaskFormVariables> resultTaskFormVariables = Optional.ofNullable(generationResult.getTaskFormVariablesByTaskId(taskId)); if (resultTaskFormVariables.isPresent()) { TaskFormVariables formVariables = resultTaskFormVariables.get(); if (!formVariables.isValid()) { throw new IllegalStateException(generateErrorMessage(formVariables)); } final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); return formVariables.toFormModel(variable -> createModelProperty(variable, projectClassLoader)); } } return null; } @Inject  BPMNFormModelGeneratorImpl(KieModuleService moduleService,
                                      ModuleClassLoaderHelper projectClassLoaderHelper); @Override BusinessProcessFormModel generateProcessFormModel(Definitions source,
                                                             Path path); @Override List<TaskFormModel> generateTaskFormModels(Definitions source,
                                                      Path path); @Override TaskFormModel generateTaskFormModel(Definitions source,
                                               String taskId,
                                               Path path); @Override Process getProcess(Definitions source);  }