use of org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallProcessProperties.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallProcessProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_PROCESSPROPERTIES);
assertDiagram(diagram, 4);
assertEquals("BPSimple", diagram.getMetadata().getTitle());
DiagramSet diagramProperties = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof BPMNDiagram) {
BPMNDiagramImpl bpmnDiagram = (BPMNDiagramImpl) oDefinition;
diagramProperties = bpmnDiagram.getDiagramSet();
break;
}
}
}
assertEquals("BPSimple", diagramProperties.getName().getValue());
assertEquals("This is a\n" + "simple\n" + "process", diagramProperties.getDocumentation().getValue());
assertEquals("JDLProj.BPSimple", diagramProperties.getId().getValue());
assertEquals("org.jbpm", diagramProperties.getPackageProperty().getValue());
assertEquals(Boolean.valueOf(true), diagramProperties.getExecutable().getValue());
assertEquals(Boolean.valueOf(true), diagramProperties.getAdHoc().getValue());
assertEquals("This is the\n" + "Process\n" + "Instance\n" + "Description", diagramProperties.getProcessInstanceDescription().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram in project kie-wb-common by kiegroup.
the class BaseDiagramMarshaller method getTitle.
private String getTitle(final Graph graph) {
final Node<Definition<BPMNDiagram>, ?> diagramNode = getFirstDiagramNode(graph);
final BPMNDiagram diagramBean = null != diagramNode ? (BPMNDiagram) ((Definition) diagramNode.getContent()).getDefinition() : null;
return getTitle(diagramBean);
}
Aggregations