use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateConditionalEvents.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateConditionalEvents() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_CONDITIONAL_EVENTS);
assertDiagram(diagram, 4);
assertEquals("IntermediateConditionalEvents", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> catchingEventNode = diagram.getGraph().getNode("_31A24997-C7B3-4286-8B4D-0EFD7CB11206");
assertNotNull(catchingEventNode);
IntermediateConditionalEvent catchingConditionalEvent = (IntermediateConditionalEvent) catchingEventNode.getContent().getDefinition();
assertNotNull(catchingConditionalEvent.getGeneral());
assertEquals("CatchingIntermediateConditionalEventName", catchingConditionalEvent.getGeneral().getName().getValue());
assertEquals("CatchingIntermediateConditionalDocumentation", catchingConditionalEvent.getGeneral().getDocumentation().getValue());
assertNotNull(catchingConditionalEvent.getExecutionSet());
assertEquals("drools", catchingConditionalEvent.getExecutionSet().getConditionExpression().getValue().getLanguage());
assertEquals("CatchingIntermediateConditionalEventCompletionCondition", catchingConditionalEvent.getExecutionSet().getConditionExpression().getValue().getScript());
assertEquals(true, catchingConditionalEvent.getExecutionSet().getCancelActivity().getValue());
assertEquals("12/25/1983", catchingConditionalEvent.getExecutionSet().getSlaDueDate().getValue());
Node<? extends Definition, ?> boundaryEventNode = diagram.getGraph().getNode("_FD2DB546-4A85-4C50-9003-548A9A354F97");
assertNotNull(boundaryEventNode);
IntermediateConditionalEvent boundaryConditionalEvent = (IntermediateConditionalEvent) boundaryEventNode.getContent().getDefinition();
assertNotNull(boundaryConditionalEvent.getGeneral());
assertEquals("BoundaryConditionalEventName", boundaryConditionalEvent.getGeneral().getName().getValue());
assertEquals("BoundaryConditionalEventDocumentation", boundaryConditionalEvent.getGeneral().getDocumentation().getValue());
assertNotNull(boundaryConditionalEvent.getExecutionSet());
assertEquals("drools", boundaryConditionalEvent.getExecutionSet().getConditionExpression().getValue().getLanguage());
assertEquals("BoundaryConditionalEventCompletionCondition", boundaryConditionalEvent.getExecutionSet().getConditionExpression().getValue().getScript());
assertEquals(true, boundaryConditionalEvent.getExecutionSet().getCancelActivity().getValue());
assertEquals("12/25/1983", boundaryConditionalEvent.getExecutionSet().getSlaDueDate().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent in project kie-wb-common by kiegroup.
the class CatchingIntermediateConditionalEventTest method testUnmarshallTopLevelEmptyEventProperties.
@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateConditionalEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertConditionalEventExecutionSet(emptyTopEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_EXPRESSION_TYPE, CANCELLING, EMPTY_VALUE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent in project kie-wb-common by kiegroup.
the class CatchingIntermediateConditionalEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_EXPRESSION_TYPE, CANCELLING, EMPTY_VALUE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent in project kie-wb-common by kiegroup.
the class CatchingIntermediateConditionalEventTest method testUnmarshallSubprocessLevelEventWithEdgesFilledProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventWithEdgesFilledProperties() {
final String EVENT_NAME = "Event04 ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Event 04 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String CONDITION_EXPRESSION_SCRIPT = "com.myspace.testproject.Person(name == \"John\")";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateConditionalEvent filledSubprocessEvent = getCatchingIntermediateNodeById(diagram, FILLED_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(filledSubprocessEvent.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertConditionalEventExecutionSet(filledSubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT, CONDITION_EXPRESSION_LANGUAGE, CONDITION_EXPRESSION_TYPE, CANCELLING, SLA_DUE_DATE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent in project kie-wb-common by kiegroup.
the class CatchingIntermediateConditionalEventTest method testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_EXPRESSION_TYPE, CANCELLING, EMPTY_VALUE);
}
Aggregations