Search in sources :

Example 6 with StartNoneEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.

the class StartNoneEventTest method testUnmarshallTopLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallTopLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME = "Hello none start event name ~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String EVENT_DOCUMENTATION = "~`!@#$%^&*()_+=-{}|\\][:\";'?><,./\nDocumentation";
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartNoneEvent filledTop = getStartNodeById(diagram, FILLED_TOP_LEVEL_EVENT_ID, StartNoneEvent.class);
    assertGeneralSet(filledTop.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 7 with StartNoneEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.

the class StartNoneEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartNoneEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartNoneEvent.class);
    assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 8 with StartNoneEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartNoneEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartNoneEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTNONEEVENT);
    assertDiagram(diagram, 4);
    assertEquals("startNoneEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startNoneEventNode = diagram.getGraph().getNode("processStartEvent");
    StartNoneEvent startNoneEvent = (StartNoneEvent) startNoneEventNode.getContent().getDefinition();
    assertNotNull(startNoneEvent.getGeneral());
    assertEquals("MyStartNoneEvent", startNoneEvent.getGeneral().getName().getValue());
    assertEquals("MyStartNoneEventDocumentation", startNoneEvent.getGeneral().getDocumentation().getValue());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 9 with StartNoneEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.

the class StartNoneEventTest method testUnmarshallTopLevelEmptyEventProperties.

@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartNoneEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, StartNoneEvent.class);
    assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 10 with StartNoneEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.

the class StartNoneEventTest method testUnmarshallSubprocessLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME = "It is also not empty ~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String EVENT_DOCUMENTATION = "Some documentation as well\n~`!@#$%^&*()_+=-{}|\\][:\";'?><,./\n";
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartNoneEvent filledSubprocess = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_ID, StartNoneEvent.class);
    assertGeneralSet(filledSubprocess.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Aggregations

StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)13 Test (org.junit.Test)11 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)6 Graph (org.kie.workbench.common.stunner.core.graph.Graph)6 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)3 ConstraintViolation (javax.validation.ConstraintViolation)2 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 ShapeView (org.kie.workbench.common.stunner.core.client.shape.view.ShapeView)2 StartEvent (org.eclipse.bpmn2.StartEvent)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 EndNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent)1 NoneTask (org.kie.workbench.common.stunner.bpmn.definition.NoneTask)1 ParallelGateway (org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway)1 ScriptTask (org.kie.workbench.common.stunner.bpmn.definition.ScriptTask)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1