Search in sources :

Example 1 with InterruptingErrorEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet in project kie-wb-common by kiegroup.

the class StartEventConverter method errorEvent.

private BpmnNode errorEvent(StartEvent event, ErrorEventDefinition e) {
    Node<View<StartErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), StartErrorEvent.class);
    StartErrorEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new InterruptingErrorEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), // avoids an ErrorRef(null) -- tests expect ""
    new ErrorRef(Optional.ofNullable(e.getErrorRef().getErrorCode()).orElse(""))));
    definition.setSimulationSet(p.getSimulationSet());
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) 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) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 2 with InterruptingErrorEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet in project kie-wb-common by kiegroup.

the class StartEventConverter method errorEvent.

private PropertyWriter errorEvent(Node<View<StartErrorEvent>, ?> n) {
    StartEvent event = bpmn2.createStartEvent();
    event.setId(n.getUUID());
    StartErrorEvent definition = n.getContent().getDefinition();
    CatchEventPropertyWriter p = propertyWriterFactory.of(event);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    InterruptingErrorEventExecutionSet executionSet = definition.getExecutionSet();
    p.addError(executionSet.getErrorRef());
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) StartEvent(org.eclipse.bpmn2.StartEvent) BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)

Example 3 with InterruptingErrorEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet in project kie-wb-common by kiegroup.

the class ProcessErrorRefProviderTest method mockStartErrorEventNode.

private Element mockStartErrorEventNode(String errorRefValue) {
    StartErrorEvent event = new StartErrorEvent();
    event.setExecutionSet(new InterruptingErrorEventExecutionSet(new IsInterrupting(true), new ErrorRef(errorRefValue)));
    return mockNode(event);
}
Also used : InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)

Example 4 with InterruptingErrorEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallIsInterruptingStartErrorEvent.

@Test
public void testUnmarshallIsInterruptingStartErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTERROREVENT);
    assertDiagram(diagram, 7);
    assertEquals("EventSubprocessStartErrorEvent", diagram.getMetadata().getTitle());
    // Check first start event with all FILLED properties
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
    StartErrorEvent startErrorEvent = (StartErrorEvent) startEventNode.getContent().getDefinition();
    BPMNGeneralSet eventGeneralSet = startErrorEvent.getGeneral();
    assertNotNull(eventGeneralSet);
    assertEquals("StartErrorEvent", eventGeneralSet.getName().getValue());
    assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet eventExecutionSet = startErrorEvent.getExecutionSet();
    assertNotNull(eventExecutionSet);
    assertNotNull(eventExecutionSet.getErrorRef());
    assertEquals("Error1", eventExecutionSet.getErrorRef().getValue());
    assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
    DataIOSet eventDataIOSet = startErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
    assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
    // Check second start event with all EMPTY properties
    Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
    StartErrorEvent emptyErrorEvent = (StartErrorEvent) emptyEventNode.getContent().getDefinition();
    BPMNGeneralSet emptyEventGeneralSet = emptyErrorEvent.getGeneral();
    assertNotNull(emptyEventGeneralSet);
    assertEquals("", emptyEventGeneralSet.getName().getValue());
    assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet emptyExecutionSet = emptyErrorEvent.getExecutionSet();
    assertNotNull(emptyExecutionSet);
    assertNotNull(emptyExecutionSet.getErrorRef());
    assertEquals("", emptyExecutionSet.getErrorRef().getValue());
    assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
    DataIOSet emptyDataIOSet = emptyErrorEvent.getDataIOSet();
    AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
    assertEquals("", emptyAssignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Example 5 with InterruptingErrorEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartErrorEvent.

@Test
public void testUnmarshallIsInterruptingStartErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTERROREVENT);
    assertDiagram(diagram, 7);
    assertEquals("EventSubprocessStartErrorEvent", diagram.getMetadata().getTitle());
    // Check first start event with all FILLED properties
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
    StartErrorEvent startErrorEvent = (StartErrorEvent) startEventNode.getContent().getDefinition();
    BPMNGeneralSet eventGeneralSet = startErrorEvent.getGeneral();
    assertNotNull(eventGeneralSet);
    assertEquals("StartErrorEvent", eventGeneralSet.getName().getValue());
    assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet eventExecutionSet = startErrorEvent.getExecutionSet();
    assertNotNull(eventExecutionSet);
    assertNotNull(eventExecutionSet.getErrorRef());
    assertEquals("Error1", eventExecutionSet.getErrorRef().getValue());
    assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
    DataIOSet eventDataIOSet = startErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
    assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
    // Check second start event with all EMPTY properties
    Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
    StartErrorEvent emptyErrorEvent = (StartErrorEvent) emptyEventNode.getContent().getDefinition();
    BPMNGeneralSet emptyEventGeneralSet = emptyErrorEvent.getGeneral();
    assertNotNull(emptyEventGeneralSet);
    assertEquals("", emptyEventGeneralSet.getName().getValue());
    assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet emptyExecutionSet = emptyErrorEvent.getExecutionSet();
    assertNotNull(emptyExecutionSet);
    assertNotNull(emptyExecutionSet.getErrorRef());
    assertEquals("", emptyExecutionSet.getErrorRef().getValue());
    assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
    DataIOSet emptyDataIOSet = emptyErrorEvent.getDataIOSet();
    AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
    assertEquals("", emptyAssignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Aggregations

StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)5 InterruptingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet)5 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 Test (org.junit.Test)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)2 ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)2 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)2 Graph (org.kie.workbench.common.stunner.core.graph.Graph)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 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