Search in sources :

Example 1 with EndTerminateEvent

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

the class EndEventConverter method terminateEndEvent.

private BpmnNode terminateEndEvent(EndEvent event, TerminateEventDefinition e) {
    Node<View<EndTerminateEvent>, Edge> node = factoryManager.newNode(event.getId(), EndTerminateEvent.class);
    EndTerminateEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) EndTerminateEvent(org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) ThrowEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 2 with EndTerminateEvent

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

the class EndEventConverter method terminateEvent.

private PropertyWriter terminateEvent(Node<View<EndTerminateEvent>, ?> n) {
    EndEvent event = bpmn2.createEndEvent();
    event.setId(n.getUUID());
    EndTerminateEvent definition = n.getContent().getDefinition();
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.addTerminate();
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : BaseEndEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent) EndEvent(org.eclipse.bpmn2.EndEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) EndTerminateEvent(org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 3 with EndTerminateEvent

use of org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent 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());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndTerminateEvent(org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent) Test(org.junit.Test)

Example 4 with EndTerminateEvent

use of org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent 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());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndTerminateEvent(org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent) Test(org.junit.Test)

Aggregations

EndTerminateEvent (org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent)4 Test (org.junit.Test)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)2 Graph (org.kie.workbench.common.stunner.core.graph.Graph)2 EndEvent (org.eclipse.bpmn2.EndEvent)1 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)1 BaseEndEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1