Search in sources :

Example 11 with CatchEventPropertyReader

use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader in project kie-wb-common by kiegroup.

the class StartEventConverter method convert.

public Result<BpmnNode> convert(StartEvent event) {
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    List<EventDefinition> eventDefinitions = p.getEventDefinitions();
    switch(eventDefinitions.size()) {
        case 0:
            return Result.success(noneEvent(event));
        case 1:
            return Match.of(EventDefinition.class, BpmnNode.class).when(SignalEventDefinition.class, e -> signalEvent(event, e)).when(MessageEventDefinition.class, e -> messageEvent(event, e)).when(TimerEventDefinition.class, e -> timerEvent(event, e)).when(ErrorEventDefinition.class, e -> errorEvent(event, e)).when(ConditionalEventDefinition.class, e -> conditionalEvent(event, e)).when(EscalationEventDefinition.class, e -> escalationEvent(event, e)).when(CompensateEventDefinition.class, e -> compensationEvent(event, e)).mode(getMode()).apply(eventDefinitions.get(0));
        default:
            throw new UnsupportedOperationException("Multiple event definitions not supported for start event");
    }
}
Also used : StartEvent(org.eclipse.bpmn2.StartEvent) EventDefinition(org.eclipse.bpmn2.EventDefinition) InterruptingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) BpmnNode(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) AbstractConverter(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.AbstractConverter) BaseStartEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseStartEventExecutionSet) InterruptingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.InterruptingEscalationEventExecutionSet) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) InterruptingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet) PropertyReaderFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.PropertyReaderFactory) List(java.util.List) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) EventDefinitionReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventDefinitionReader) NodeConverter(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.NodeConverter) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) Node(org.kie.workbench.common.stunner.core.graph.Node) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) View(org.kie.workbench.common.stunner.core.graph.content.view.View) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) TypedFactoryManager(org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet) Result(org.kie.workbench.common.stunner.bpmn.backend.converters.Result) EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) Match(org.kie.workbench.common.stunner.bpmn.backend.converters.Match) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) Mode(org.kie.workbench.common.stunner.core.marshaller.MarshallingRequest.Mode) EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) BpmnNode(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode) EventDefinition(org.eclipse.bpmn2.EventDefinition) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition)

Example 12 with CatchEventPropertyReader

use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader in project kie-wb-common by kiegroup.

the class IntermediateCatchEventConverter method errorEvent.

protected Result<BpmnNode> errorEvent(CatchEvent event, ErrorEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateErrorEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class);
    IntermediateErrorEventCatching definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new ErrorRef(EventDefinitionReader.errorRefOf(e))));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Aggregations

CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)12 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)12 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)12 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)12 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)12 Edge (org.kie.workbench.common.stunner.core.graph.Edge)12 View (org.kie.workbench.common.stunner.core.graph.content.view.View)12 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)11 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)10 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)10 ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)5 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)5 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)5 TimerSettings (org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings)5 List (java.util.List)4 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)4 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)4 ErrorEventDefinition (org.eclipse.bpmn2.ErrorEventDefinition)4 EscalationEventDefinition (org.eclipse.bpmn2.EscalationEventDefinition)4 EventDefinition (org.eclipse.bpmn2.EventDefinition)4