Search in sources :

Example 1 with ErrorRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef 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 ErrorRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef 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 3 with ErrorRef

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

the class ProcessErrorRefProviderTest method mockIntermediateErrorEventCatchingNode.

private Node mockIntermediateErrorEventCatchingNode(String errorRefValue) {
    IntermediateErrorEventCatching event = new IntermediateErrorEventCatching();
    event.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(true), new ErrorRef(errorRefValue)));
    return mockNode(event);
}
Also used : IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 4 with ErrorRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef 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 5 with ErrorRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef 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)

Aggregations

ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)6 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)3 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 CancellingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet)3 InterruptingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)3 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)3 Edge (org.kie.workbench.common.stunner.core.graph.Edge)3 View (org.kie.workbench.common.stunner.core.graph.content.view.View)3 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)2 EndErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent)2 IntermediateErrorEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching)2 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)2 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)2 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)2 ErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet)2 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)1