use of org.eclipse.bpmn2.ServiceTask 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());
}
Aggregations