use of org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel in project kie-wb-common by kiegroup.
the class BPMFinderServiceImpl method scannProcessesForType.
protected void scannProcessesForType(final Path path, final String extension, final GenerationConfig generationConfig) {
List<org.uberfire.java.nio.file.Path> nioPaths = new ArrayList<>();
nioPaths.add(Paths.convert(path));
Collection<FileUtils.ScanResult> processes = fileUtils.scan(ioService, nioPaths, extension, true);
processes.stream().map(scanResult -> parse(scanResult)).filter(definitions -> definitions != null && generationConfig.getPredicate().test(definitions)).forEach(definitions -> {
BusinessProcessFormModel processFormModel = bpmnFormModelGenerator.generateProcessFormModel(definitions.get(), path);
List<TaskFormModel> taskModels = bpmnFormModelGenerator.generateTaskFormModels(definitions.get(), path);
generationConfig.getConsumer().accept(new JBPMProcessModel(processFormModel, taskModels));
});
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel in project kie-wb-common by kiegroup.
the class GetProcessModelsTest method assertModelWithName.
private void assertModelWithName(String process, Map<String, String> variables, Map<String, Map<String, String>> tasks) {
for (JBPMProcessModel model : availableProcessModels) {
if (process.equals(model.getProcessFormModel().getProcessName())) {
assertThat(getProcessVariables(model)).isEqualTo(variables);
assertThat(getTaskModels(model)).isEqualTo(tasks);
}
}
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel in project kie-wb-common by kiegroup.
the class TaskFormModelHandlerTest method getFullProcessModel.
protected JBPMProcessModel getFullProcessModel() {
JBPMProcessModel processModel = getBaseProcessModel();
processModel.getTaskFormModels().add(new TaskFormModel(PROCESS_ID, TASK_NAME, propertyList));
return processModel;
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel in project kie-wb-common by kiegroup.
the class JBPMFormModelCreationViewImpl method init.
@PostConstruct
protected void init() {
processes.addValueChangeHandler(event -> {
JBPMProcessModel model = processes.getValue();
if (model != null) {
List<JBPMFormModel> models = new ArrayList<JBPMFormModel>();
models.add(model.getProcessFormModel());
models.addAll(model.getTaskFormModels());
tasks.setValue(null);
tasks.setAcceptableValues(models);
} else {
tasks.setAcceptableValues(new ArrayList<>());
tasks.setValue(null, true);
}
});
tasks.addValueChangeHandler(event -> {
presenter.setModel(event.getValue());
clearValidationErrors();
});
}
use of org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel in project kie-wb-common by kiegroup.
the class BPMFinderServiceImplTest method testFindProcess.
protected void testFindProcess(String processId, int expectedTasks) {
JBPMProcessModel model = bpmFinderService.getModelForProcess(processId, currentModulePath);
assertNotNull(model);
assertNotNull(model.getProcessFormModel());
assertEquals(processId, model.getProcessFormModel().getProcessId());
assertEquals(expectedTasks, model.getTaskFormModels().size());
}
Aggregations