use of org.kie.workbench.common.stunner.core.graph.Graph in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartSignalEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartSignalEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTSIGNALEVENT);
assertDiagram(diagram, 4);
assertEquals("StartSignalEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> startSignalEventNode = diagram.getGraph().getNode("_1876844A-4DAC-4214-8BCD-2ABA3FCC8EB5");
StartSignalEvent startSignalEvent = (StartSignalEvent) startSignalEventNode.getContent().getDefinition();
assertNotNull(startSignalEvent.getExecutionSet());
SignalRef signalRef = startSignalEvent.getExecutionSet().getSignalRef();
assertEquals("sig1", signalRef.getValue());
}
use of org.kie.workbench.common.stunner.core.graph.Graph in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest 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.graph.Graph in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallSimulationProperties.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallSimulationProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_SIMULATIONPROPERTIES);
assertDiagram(diagram, 4);
assertEquals("SimulationProperties", diagram.getMetadata().getTitle());
SimulationSet simulationSet = 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 UserTask) {
UserTask userTask = (UserTask) oDefinition;
simulationSet = userTask.getSimulationSet();
break;
}
}
}
assertEquals(Double.valueOf(111), simulationSet.getQuantity().getValue());
assertEquals("poisson", simulationSet.getDistributionType().getValue());
assertEquals(Double.valueOf(123), simulationSet.getUnitCost().getValue());
assertEquals(Double.valueOf(999), simulationSet.getWorkingHours().getValue());
assertEquals(Double.valueOf(321), simulationSet.getMean().getValue());
}
use of org.kie.workbench.common.stunner.core.graph.Graph in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndTerminateEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndTerminateEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDTERMINATEEVENT);
assertDiagram(diagram, 3);
assertEquals("endTerminateEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> endNoneEventNode = diagram.getGraph().getNode("_1B379E3E-E4ED-4BD2-AEE8-CD85374CEC78");
EndTerminateEvent endTerminateEvent = (EndTerminateEvent) endNoneEventNode.getContent().getDefinition();
assertNotNull(endTerminateEvent.getGeneral());
assertEquals("MyEndTerminateEvent", endTerminateEvent.getGeneral().getName().getValue());
assertEquals("MyEndTerminateEventDocumentation", endTerminateEvent.getGeneral().getDocumentation().getValue());
}
use of org.kie.workbench.common.stunner.core.graph.Graph in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
assertNotNull(intermediateMessageEventCatching.getExecutionSet());
MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
assertEquals("msgref1", messageRef.getValue());
DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
Aggregations