textAnnotation.getDocumentation().get(0).getText());
@Test public void testBasicMarshall() throws Exception { Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); Definitions definitions = convertToDefinitions(d); org.eclipse.bpmn2.Task serviceTask = ((Process) definitions.getRootElements().get(0)) .getFlowElements() .stream() .filter(org.eclipse.bpmn2.Task.class::isInstance) .map(org.eclipse.bpmn2.Task.class::cast) .findFirst().get(); assertEquals("Custom Email", serviceTask.getName()); assertEquals("<![CDATA[This is an email task]]>", serviceTask.getDocumentation().get(0).getText()); }
@Test public void JBPM_7523_shouldPreserveNameChars() { Lane lane = bpmn2.createLane(); PropertyWriterFactory writerFactory = new PropertyWriterFactory(); LanePropertyWriter w = writerFactory.of(lane); String aWeirdName = " XXX !!@@ <><> "; String aWeirdDoc = " XXX !!@@ <><> Docs "; w.setName(aWeirdName); w.setDocumentation(aWeirdDoc); assertThat(lane.getName()).isEqualTo(StringEscapeUtils.escapeXml10(aWeirdName.trim())); assertThat(CustomElement.name.of(lane).get()).isEqualTo(asCData(aWeirdName)); assertThat(lane.getDocumentation().get(0).getText()).isEqualTo(asCData(aWeirdDoc)); } }
if (rootElement.getDocumentation() != null && rootElement.getDocumentation().size() > 0) { props.put(DOCUMENTATION, rootElement.getDocumentation().get(0).getText());
@Test public void JBPM_7522_shouldPersistProperties() { TestSequenceFlowWriter w = new TestSequenceFlowWriter(); SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID); String name = "Name"; String doc = "Doc"; String priority = "100"; ScriptTypeValue scriptTypeValue = new ScriptTypeValue("java", "System.out.println(1);"); p.setName(name); p.setDocumentation(doc); p.setPriority(priority); p.setConditionExpression(scriptTypeValue); org.eclipse.bpmn2.SequenceFlow seq = (org.eclipse.bpmn2.SequenceFlow) p.getFlowElement(); assertThat(seq.getName()).isEqualTo(name); assertThat(seq.getDocumentation().get(0).getText()).isEqualTo(asCData(doc)); assertThat(CustomAttribute.priority.of(seq).get()).isEqualTo(priority); assertThat(seq.getConditionExpression()).isNotNull(); }
@Test public void testSetDocumentationNotEmpty() { p.setDocumentation("DocumentationValue"); assertNotNull(p.getProcess().getDocumentation()); assertEquals(1, p.getProcess().getDocumentation().size()); assertEquals("<![CDATA[DocumentationValue]]>", p.getProcess().getDocumentation().get(0).getText()); } }
assertFalse(process.getDocumentation().isEmpty()); assertEquals("<![CDATA[This is a\nsimple\nprocess]]>", process.getDocumentation().get(0).getText()); assertEquals("<![CDATA[This is the\nProcess\nInstance\nDescription]]>", getProcessExtensionValue(process,
assertFalse(process.getDocumentation().isEmpty()); assertEquals("<![CDATA[This is a\nsimple\nprocess]]>", process.getDocumentation().get(0).getText()); assertEquals("<![CDATA[This is the\nProcess\nInstance\nDescription]]>", getProcessExtensionValue(process,