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); }
private void assertDocumentation(Diagram<Graph, Metadata> diagram, String id, String value) { Optional<BPMNDefinition> documentation = getNodes(diagram).stream() .filter(node -> node.getContent() instanceof View && node.getUUID().equals(id)) .map(node -> (View) node.getContent()) .filter(view -> view.getDefinition() instanceof BPMNDefinition) .map(view -> (BPMNDefinition) view.getDefinition()) .findFirst(); String documentationValue = (documentation.isPresent() ? documentation.get().getGeneral().getDocumentation().getValue() : null); assertEquals(value, documentationValue); }
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()); }
private PropertyWriter noneEvent(Node<View<StartNoneEvent>, ?> n) { StartEvent event = bpmn2.createStartEvent(); event.setId(n.getUUID()); StartNoneEvent definition = n.getContent().getDefinition(); CatchEventPropertyWriter p = propertyWriterFactory.of(event); event.setIsInterrupting(definition.getIsInterrupting().getValue()); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }
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()); }
private PropertyWriter timerEvent(Node<View<IntermediateTimerEvent>, ?> n) { CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); p.getFlowElement().setId(n.getUUID()); IntermediateTimerEvent definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); CancellingTimerEventExecutionSet executionSet = definition.getExecutionSet(); p.setCancelActivity(executionSet.getCancelActivity().getValue()); p.addTimer(executionSet.getTimerSettings()); p.setBounds(n.getContent().getBounds()); return p; }
@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()); } }
@Test public void testBuild() { final ServiceTask serviceTask = tested.build(getWorkItemDefinitionName()); assertEquals(WID_NAME, serviceTask.getName()); assertEquals(WID_NAME, serviceTask.getTaskType().getRawType()); assertEquals(WID_NAME, serviceTask.getExecutionSet().getTaskName().getValue()); assertEquals(WID_CAT, serviceTask.getCategory()); assertEquals(WID_HANDLER, serviceTask.getDefaultHandler()); assertEquals(WID_DISP_NAME, serviceTask.getGeneral().getName().getValue()); assertEquals(WID_DOC, serviceTask.getGeneral().getDocumentation().getValue()); assertEquals(WID_DESC, serviceTask.getDescription()); assertEquals(WID_PARAMS + WID_RESULTS, serviceTask.getDataIOSet().getAssignmentsinfo().getValue()); }