use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIsInterruptingStartErrorEvent.
@Test
public void testMarshallIsInterruptingStartErrorEvent() throws Exception {
Diagram<Graph, Metadata> testIt = unmarshall(BPMN_EVENT_SUBPROCESS_STARTERROREVENT);
String result = tested.marshall(testIt);
assertDiagram(result, 1, 6, 2);
Diagram<Graph, Metadata> marshalledDiagram = unmarshall(getStream(result));
assertDiagram(marshalledDiagram, 7);
assertEquals("EventSubprocessStartErrorEvent", marshalledDiagram.getMetadata().getTitle());
Node<? extends Definition, ?> filledEventNode = testIt.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
Node<? extends Definition, ?> marshalledFilledEventNode = marshalledDiagram.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
assertEquals(filledEventNode, marshalledFilledEventNode);
Node<? extends Definition, ?> emptyEventNode = marshalledDiagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
Node<? extends Definition, ?> marshalledEmptyEventNode = marshalledDiagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
assertEquals(emptyEventNode, marshalledEmptyEventNode);
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEndMessageEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDMESSAGEEVENT);
assertDiagram(diagram, 2);
assertEquals("EndMessageEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> endMessageEventNode = diagram.getGraph().getNode("_4A8A0A9E-D4A5-4B6E-94A6-20817A57B3C6");
EndMessageEvent endMessageEvent = (EndMessageEvent) endMessageEventNode.getContent().getDefinition();
assertNotNull(endMessageEvent.getExecutionSet());
MessageRef messageRef = endMessageEvent.getExecutionSet().getMessageRef();
assertEquals("msgref", messageRef.getValue());
DataIOSet dataIOSet = endMessageEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("EndMessageEventInputVar1:String||||[din]var1->EndMessageEventInputVar1", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallXorGateway.
@Test
public void testMarshallXorGateway() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_XORGATEWAY);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 6, 5);
assertTrue(result.contains("<bpmn2:exclusiveGateway id=\"_877EA035-1A14-42E9-8CAA-43E9BF908C70\" drools:dg=\"_5110D608-BDAD-47BF-A3F9-E1DBE43ED7CD\" name=\"AgeSplit\" gatewayDirection=\"Diverging\" default=\"_5110D608-BDAD-47BF-A3F9-E1DBE43ED7CD\">"));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallMagnetDockers.
@Test
public void testMarshallMagnetDockers() throws Exception {
Diagram<Graph, Metadata> diagram1 = unmarshall(BPMN_MAGNETDOCKERS);
String result = tested.marshall(diagram1);
assertDiagram(result, 1, 8, 7);
Diagram<Graph, Metadata> diagram2 = unmarshall(new ByteArrayInputStream(result.getBytes()));
testMagnetDockers(diagram2);
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIntermediateTimerEvent.
@Test
public void testMarshallIntermediateTimerEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_TIMER_EVENT);
IntermediateTimerEvent timerEvent = 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 IntermediateTimerEvent) {
timerEvent = (IntermediateTimerEvent) oDefinition;
break;
}
}
}
assertNotNull(timerEvent);
assertNotNull(timerEvent.getGeneral());
assertNotNull(timerEvent.getExecutionSet());
assertEquals("myTimeDateValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDate());
assertEquals("MyTimeDurationValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDuration());
assertEquals("myTimeCycleValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycle());
assertEquals("cron", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycleLanguage());
}
Aggregations