protected String getTaskName() { String taskName = "Task"; if (bpmnModel != null && bpmnModel instanceof BaseTask) { BaseTask task = (BaseTask) bpmnModel; if (task.getGeneral() != null && task.getGeneral().getName() != null && task.getGeneral().getName().getValue() != null && task.getGeneral().getName().getValue().length() > 0) { taskName = task.getGeneral().getName().getValue(); } } return taskName; }
private static Pair<Object, String> buildPair(final String uuid, final BPMNDefinition definition) { String name = definition.getGeneral().getName().getValue(); return new Pair<>(uuid, isEmpty(name) ? uuid : name); } }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertThat(generalSet).isNotNull(); assertThat(generalSet.getName()).isNotNull(); assertThat(generalSet.getDocumentation()).isNotNull(); assertThat(generalSet.getName().getValue()).isEqualTo(nodeName); assertThat(generalSet.getDocumentation().getValue()).isEqualTo(documentation); }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertThat(generalSet).isNotNull(); assertThat(generalSet.getName()).isNotNull(); assertThat(generalSet.getDocumentation()).isNotNull(); assertThat(generalSet.getName().getValue()).isEqualTo(nodeName); assertThat(generalSet.getDocumentation().getValue()).isEqualTo(documentation); }
private void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertThat(generalSet).isNotNull(); assertThat(generalSet.getName()).isNotNull(); assertThat(generalSet.getDocumentation()).isNotNull(); assertThat(generalSet.getName().getValue()).isEqualTo(nodeName); assertThat(generalSet.getDocumentation().getValue()).isEqualTo(documentation); }
@Test @SuppressWarnings("unchecked") public void testBuildNoPackageSpecified() { when(metadata.getProjectPackage()).thenReturn(null); ProjectDiagram pdiagram = tested.build(NAME, metadata, graph); assertNotNull(pdiagram); assertEquals(graph, pdiagram.getGraph()); assertEquals(NAME, id.getValue()); assertEquals(NAME, name.getValue()); assertEquals(Package.DEFAULT_PACKAGE, packageProperty.getValue()); verify(metadata, times(1)).setCanvasRootUUID(eq(DIAGRAM_NODE_UUID)); }
@Test @SuppressWarnings("unchecked") public void testBuildWithAttributesSet() { final String id2 = "id"; final String name2 = "name2"; this.id.setValue(id2); name.setValue(name2); ProjectDiagram pdiagram = tested.build(NAME, metadata, graph); assertEquals(id2, this.id.getValue()); assertEquals(name2, name.getValue()); }
private PropertyWriter noneEvent(Node<View<EndNoneEvent>, ?> n) { EndEvent event = bpmn2.createEndEvent(); event.setId(n.getUUID()); BaseEndEvent definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setBounds(n.getContent().getBounds()); return p; }
private PropertyWriter compensationEvent(Node<View<IntermediateCompensationEvent>, ?> n) { CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); p.getFlowElement().setId(n.getUUID()); IntermediateCompensationEvent definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addCompensation(); p.setBounds(n.getContent().getBounds()); return p; }
private PropertyWriter terminateEvent(Node<View<EndTerminateEvent>, ?> n) { EndEvent event = bpmn2.createEndEvent(); event.setId(n.getUUID()); EndTerminateEvent definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addTerminate(); p.setBounds(n.getContent().getBounds()); return p; }
private PropertyWriter compensationEvent(Node<View<EndCompensationEvent>, ?> n) { EndEvent event = bpmn2.createEndEvent(); event.setId(n.getUUID()); EndCompensationEvent definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addCompensation(); p.setBounds(n.getContent().getBounds()); return p; } }
private PropertyWriter compensationEvent(Node<View<IntermediateCompensationEventThrowing>, ?> n) { IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); event.setId(n.getUUID()); IntermediateCompensationEventThrowing definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addCompensation(); p.setBounds(n.getContent().getBounds()); return p; } }
private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) { Task task = bpmn2.createTask(); task.setId(n.getUUID()); NoneTask definition = n.getContent().getDefinition(); ActivityPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setBounds(n.getContent().getBounds()); p.setSimulationSet(definition.getSimulationSet()); return p; } }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); }
void assertGeneralSet(TaskGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); } }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); }
void assertGeneralSet(BPMNGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); }
@Test public void testBasicUnmarshall() throws Exception { Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); Node<View<ServiceTask>, ?> node = d.getGraph().getNode(SERVICE_TASK_ID); ServiceTask definition = node.getContent().getDefinition(); assertEquals("Custom Email", definition.getGeneral().getName().getValue()); assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue()); }
@Test public void testBasicBidi() throws Exception { Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); String marshall = newMarshaller.marshall(d); Diagram<Graph, Metadata> d2 = Unmarshalling.unmarshall(newMarshaller, new StringInputStream(marshall)); Node<View<ServiceTask>, ?> node = d2.getGraph().getNode(SERVICE_TASK_ID); ServiceTask definition = node.getContent().getDefinition(); assertEquals("Custom Email", definition.getGeneral().getName().getValue()); assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue()); } }