use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallNotBoundaryEvents.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallNotBoundaryEvents() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_NOT_BOUNDARY_EVENTS);
assertEquals("Not Boundary Event", diagram.getMetadata().getTitle());
assertDiagram(diagram, 6);
// Assert than the intermediate event is connected using a view connector,
// so not boundary to the task ( not docked ).
Node event = diagram.getGraph().getNode("_CB178D55-8DC2-4CAA-8C42-4F5028D4A1F6");
List<Edge> inEdges = event.getInEdges();
boolean foundViewConnector = false;
for (Edge e : inEdges) {
if (e.getContent() instanceof ViewConnector) {
foundViewConnector = true;
}
}
assertTrue(foundViewConnector);
// Assert absolute position as the node is not docked.
Bounds bounds = ((View) event.getContent()).getBounds();
Bounds.Bound ul = bounds.getUpperLeft();
Bounds.Bound lr = bounds.getLowerRight();
assertEquals(305, ul.getX(), 0);
assertEquals(300, ul.getY(), 0);
assertEquals(335, lr.getX(), 0);
assertEquals(330, lr.getY(), 0);
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIntermediateMessageEventCatching.
@Test
public void testMarshallIntermediateMessageEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:intermediateCatchEvent"));
assertTrue(result.contains(" name=\"IntermediateMessageEventCatching\""));
assertTrue(result.contains("<bpmn2:message "));
assertTrue(result.contains(" name=\"msgref1\""));
assertTrue(result.contains("<bpmn2:messageEventDefinition"));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallStartTimerEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartTimerEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTTIMEREVENT);
assertDiagram(diagram, 4);
assertEquals("StartTimerEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> startTimerEventNode = diagram.getGraph().getNode("_49ADC988-B63D-4AEB-B811-67969F305FD0");
StartTimerEvent startTimerEvent = (StartTimerEvent) startTimerEventNode.getContent().getDefinition();
IsInterrupting isInterrupting = startTimerEvent.getExecutionSet().getIsInterrupting();
assertEquals(false, isInterrupting.getValue());
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIntermediatErrorEventCatching.
@Test
public void testMarshallIntermediatErrorEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ERROR_EVENTCATCHING);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:intermediateCatchEvent"));
assertTrue(result.contains(" name=\"MyErrorCatchingEvent\""));
assertTrue(result.contains("<bpmn2:errorEventDefinition"));
assertTrue(result.contains("errorRef=\"MyError\""));
assertTrue(result.contains("<bpmn2:error"));
assertTrue(result.contains("id=\"MyError\""));
assertTrue(result.contains("errorCode=\"MyError\""));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallEndMessageEvent.
@Test
public void testMarshallEndMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDMESSAGEEVENT);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:endEvent id=\"_4A8A0A9E-D4A5-4B6E-94A6-20817A57B3C6\""));
assertTrue(result.contains(" name=\"EndMessageEvent\""));
assertTrue(result.contains("<bpmn2:message "));
assertTrue(result.contains(" name=\"msgref\""));
assertTrue(result.contains("<bpmn2:messageEventDefinition"));
}
Aggregations