Search in sources :

Example 1 with EndErrorEvent

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

the class ProcessErrorRefProviderTest method mockEndErrorEventNode.

private Node mockEndErrorEventNode(String errorRefValue) {
    EndErrorEvent event = new EndErrorEvent();
    event.setExecutionSet(new ErrorEventExecutionSet(new ErrorRef(errorRefValue)));
    return mockNode(event);
}
Also used : ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) ErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet)

Example 2 with EndErrorEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndErrorEvent.

@Test
public void testUnmarshallEndErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDERROR_EVENT);
    assertDiagram(diagram, 2);
    assertEquals("endErrorEventProcess", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_E69BD781-AB7F-45C4-85DA-B1F3BAE5BCCB");
    EndErrorEvent endErrorEvent = (EndErrorEvent) endEventNode.getContent().getDefinition();
    assertNotNull(endErrorEvent.getGeneral());
    assertEquals("MyErrorEventName", endErrorEvent.getGeneral().getName().getValue());
    assertEquals("MyErrorEventDocumentation", endErrorEvent.getGeneral().getDocumentation().getValue());
    assertNotNull(endErrorEvent.getExecutionSet());
    assertNotNull(endErrorEvent.getExecutionSet().getErrorRef());
    assertEquals("MyError", endErrorEvent.getExecutionSet().getErrorRef().getValue());
    DataIOSet dataIOSet = endErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("myErrorEventInput:String||||[din]var1->myErrorEventInput", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) Test(org.junit.Test)

Example 3 with EndErrorEvent

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

the class EndEventConverter method errorEventDefinition.

private BpmnNode errorEventDefinition(EndEvent event, ErrorEventDefinition e) {
    Node<View<EndErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), EndErrorEvent.class);
    EndErrorEvent 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 ErrorEventExecutionSet(new ErrorRef(e.getErrorRef().getErrorCode())));
    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) 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) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet) 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 4 with EndErrorEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallEndErrorEvent.

public void testUnmarshallEndErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDERROR_EVENT);
    assertDiagram(diagram, 2);
    assertEquals("endErrorEventProcess", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_E69BD781-AB7F-45C4-85DA-B1F3BAE5BCCB");
    EndErrorEvent endErrorEvent = (EndErrorEvent) endEventNode.getContent().getDefinition();
    assertNotNull(endErrorEvent.getGeneral());
    assertEquals("MyErrorEventName", endErrorEvent.getGeneral().getName().getValue());
    assertEquals("MyErrorEventDocumentation", endErrorEvent.getGeneral().getDocumentation().getValue());
    assertNotNull(endErrorEvent.getExecutionSet());
    assertNotNull(endErrorEvent.getExecutionSet().getErrorRef());
    assertEquals("MyError", endErrorEvent.getExecutionSet().getErrorRef().getValue());
    DataIOSet dataIOSet = endErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("myErrorEventInput:String||||[din]var1->myErrorEventInput", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent)

Example 5 with EndErrorEvent

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

the class EndEventConverter method errorEvent.

private PropertyWriter errorEvent(Node<View<EndErrorEvent>, ?> n) {
    EndEvent event = bpmn2.createEndEvent();
    event.setId(n.getUUID());
    EndErrorEvent definition = n.getContent().getDefinition();
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    ErrorEventExecutionSet executionSet = definition.getExecutionSet();
    p.addError(executionSet.getErrorRef());
    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) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) ErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Aggregations

EndErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent)5 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 ErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet)3 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)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 Test (org.junit.Test)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 CancellingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet)1 InterruptingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet)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