use of org.kie.dmn.model.v1_1.Definitions in project kie-wb-common by kiegroup.
the class EventSubprocessPropertyReaderTest method setUp.
@Before
public void setUp() {
Definitions definitions = bpmn2.createDefinitions();
definitions.getRootElements().add(bpmn2.createProcess());
BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
bpmnDiagram.setPlane(di.createBPMNPlane());
definitions.getDiagrams().add(bpmnDiagram);
definitionResolverReal = new DefinitionResolver(definitions, Collections.emptyList());
}
use of org.kie.dmn.model.v1_1.Definitions in project kie-wb-common by kiegroup.
the class CallActivityPropertyReaderTest method setUp.
@Before
public void setUp() {
Definitions definitions = bpmn2.createDefinitions();
definitions.getRootElements().add(bpmn2.createProcess());
BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
bpmnDiagram.setPlane(di.createBPMNPlane());
definitions.getDiagrams().add(bpmnDiagram);
definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
}
use of org.kie.dmn.model.v1_1.Definitions in project kie-wb-common by kiegroup.
the class BPMNFormModelGeneratorImpl method generateTaskFormModels.
@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();
}
use of org.kie.dmn.model.v1_1.Definitions in project kie-wb-common by kiegroup.
the class GenericServiceTaskTest method marshallServiceTask.
@Test
public void marshallServiceTask() throws Exception {
Diagram<Graph, Metadata> d = unmarshall(marshaller, BPMN_FILE_PATH);
DefinitionsConverter definitionsConverter = new DefinitionsConverter(d.getGraph());
Definitions definitions = definitionsConverter.toDefinitions();
Process p = (Process) definitions.getRootElements().get(0);
assertEquals(ServiceTaskImpl.class, p.getFlowElements().stream().filter(e -> e.getId().equals(TASK_ID)).findFirst().get().getClass());
org.eclipse.bpmn2.ServiceTask flowElement = (org.eclipse.bpmn2.ServiceTask) p.getFlowElements().stream().filter(e -> e.getId().equals(TASK_ID)).findFirst().get();
assertEquals("Service", flowElement.getName());
assertEquals("op", flowElement.getOperationRef().getName());
assertEquals("Java", CustomAttribute.serviceImplementation.of(flowElement).get());
assertEquals("op", CustomAttribute.serviceOperation.of(flowElement).get());
assertEquals("hgfhfgh", CustomAttribute.serviceInterface.of(flowElement).get());
}
use of org.kie.dmn.model.v1_1.Definitions in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorImpl method generateSelectedFormsForTasks.
private void generateSelectedFormsForTasks(Diagram diagram, String... taskIds) {
try {
final String idsRaw = Arrays.stream(taskIds).collect(Collectors.joining(","));
LOGGER.finest("Generating form for tasks " + idsRaw);
final Path path = diagram.getMetadata().getPath();
org.uberfire.java.nio.file.Path nioPath = Paths.convert(path);
ioService.startBatch(ioService.getFileSystem(nioPath.toUri()));
final Definitions definitions = toDefinitions(diagram);
for (String taskId : taskIds) {
final TaskFormModel formModel = bpmnFormModelGenerator.generateTaskFormModel(definitions, taskId, path);
createFormForModel(formModel, nioPath);
}
} catch (Exception ex) {
LOGGER.severe("Error generating task forms");
throw new RuntimeException(ex);
} finally {
ioService.endBatch();
}
}
Aggregations