use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallWorkItems.
@Test
public void testMarshallWorkItems() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_SERVICE_TASKS);
String result = tested.marshall(diagram);
System.out.println(result);
assertDiagram(result, 1, 4, 3);
assertTrue(result.contains("drools:taskName=\"Email\""));
assertTrue(result.contains("drools:taskName=\"Log\""));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEventSubprocess.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEventSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS);
assertDiagram(diagram, 2);
assertEquals("EventSubProcess", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> eventSubprocessNode = diagram.getGraph().getNode("_DF031493-5F1C-4D2B-9916-2FEABB1FADFF");
EventSubprocess eventSubprocess = (EventSubprocess) eventSubprocessNode.getContent().getDefinition();
assertTrue(eventSubprocess.getIsAsync().getValue());
assertEquals("Var1:String", eventSubprocess.getProcessData().getProcessVariables().getValue());
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallUserTaskAssignments.
@Test
public void testMarshallUserTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNMENTS);
JBPMBpmn2ResourceImpl resource = tested.marshallToBpmn2Resource(diagram);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 7, 7);
Definitions definitions = (Definitions) resource.getContents().get(0);
assertNotNull(definitions);
Process process = getProcess(definitions);
assertNotNull(process);
org.eclipse.bpmn2.UserTask userTask = (org.eclipse.bpmn2.UserTask) getNamedFlowElement(process, org.eclipse.bpmn2.UserTask.class, "Self Evaluation");
assertNotNull(userTask);
DataInput dataInput = (DataInput) getDataInput(userTask, "reason");
validateDataInputOrOutput(dataInput, "_reasonInputX", "com.test.Reason", "_reasonInputXItem");
DataOutput dataOutput = (DataOutput) getDataOutput(userTask, "performance");
validateDataInputOrOutput(dataOutput, "_performanceOutputX", "Object", "_performanceOutputXItem");
ItemAwareElement sourceRef = getDataInputAssociationSourceRef(userTask, "reason");
assertNotNull(sourceRef);
ItemAwareElement targetRef = getDataInputAssociationTargetRef(userTask, "_reasonInputX");
assertNotNull(targetRef);
sourceRef = getDataOutputAssociationSourceRef(userTask, "_performanceOutputX");
assertNotNull(sourceRef);
targetRef = getDataOutputAssociationTargetRef(userTask, "performance");
assertNotNull(targetRef);
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallInclusiveGateway.
@Test
public void testMarshallInclusiveGateway() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INCLUSIVE_GATEWAY);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 6, 6);
assertTrue(result.contains("<bpmn2:inclusiveGateway id=\"_526EE472-FE8B-4E9A-A951-CFBA86C3691F\" drools:dg=\"_3D5701E9-CFD3-4218-9200-897B6D4FF041\" name=\"InclusiveGatewayName\" gatewayDirection=\"Diverging\" default=\"_3D5701E9-CFD3-4218-9200-897B6D4FF041\">"));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest 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());
}
Aggregations