use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallNotBoundaryEvents.
@Test
public void testMarshallNotBoundaryEvents() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_NOT_BOUNDARY_EVENTS);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 5, 4);
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallBusinessRuleTask.
@Test
public void testUnmarshallBusinessRuleTask() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BUSINESSRULETASKRULEFLOWGROUP);
BusinessRuleTask businessRuleTask = 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 BusinessRuleTask) {
businessRuleTask = (BusinessRuleTask) oDefinition;
break;
}
}
}
assertNotNull(businessRuleTask);
assertNotNull(businessRuleTask.getExecutionSet());
assertNotNull(businessRuleTask.getExecutionSet().getRuleFlowGroup());
assertNotNull(businessRuleTask.getGeneral());
assertNotNull(businessRuleTask.getGeneral().getName());
assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE);
assertEquals("my business rule task", businessRuleTask.getGeneral().getName().getValue());
assertEquals("my-ruleflow-group", businessRuleTask.getExecutionSet().getRuleFlowGroup().getValue());
assertEquals("true", businessRuleTask.getExecutionSet().getIsAsync().getValue().toString());
assertEquals("true", businessRuleTask.getExecutionSet().getIsAsync().getValue().toString());
assertEquals("System.out.println(\"Hello\");", businessRuleTask.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getScript());
assertEquals("java", businessRuleTask.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getLanguage());
assertEquals("System.out.println(\"Bye\");", businessRuleTask.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getScript());
assertEquals("java", businessRuleTask.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getLanguage());
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallTimerIntermediateEvent.
@Test
public void testMarshallTimerIntermediateEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_TIMER_EVENT);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:intermediateCatchEvent"));
assertTrue(result.contains(" name=\"MyTimer\""));
assertTrue(result.contains("<bpmn2:timerEventDefinition"));
assertTrue(result.contains("<bpmn2:timeDate"));
assertTrue(result.contains("<bpmn2:timeDuration"));
assertTrue(result.contains("<bpmn2:timeCycle"));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallEndErrorEnd.
public void testMarshallEndErrorEnd() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDERROR_EVENT);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:error id=\"MyError\" errorCode=\"MyError\"/>"));
assertTrue(result.contains("<bpmn2:endEvent"));
assertTrue(result.contains(" name=\"MyErrorEventName\""));
assertTrue(result.contains("<bpmn2:errorEventDefinition"));
assertTrue(result.contains(" errorRef=\"MyError\""));
assertTrue(result.contains(" drools:erefname=\"MyError\""));
}
use of org.kie.workbench.common.stunner.core.diagram.Metadata in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIntermediateSignalEventThrowing.
@Test
public void testMarshallIntermediateSignalEventThrowing() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_SIGNAL_EVENTTHROWING);
String result = tested.marshall(diagram);
assertDiagram(result, 1, 1, 0);
assertTrue(result.contains("<bpmn2:intermediateThrowEvent"));
assertTrue(result.contains(" name=\"MySignalThrowingEvent\""));
assertTrue(result.contains("<bpmn2:signalEventDefinition"));
assertTrue(result.contains(" signalRef=\"_3b677877-9be0-3fe7-bfc4-94a862fdc919\""));
assertTrue(result.contains("<bpmn2:signal"));
assertTrue(result.contains("name=\"MySignal\""));
assertTrue(result.contains("<drools:metaData name=\"customScope\">"));
assertTrue(result.contains("<drools:metaValue><![CDATA[processInstance]]></drools:metaValue>"));
}
Aggregations