Search in sources :

Example 1 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 convertIntermediateCatchEvent.

public BpmnNode convertIntermediateCatchEvent(IntermediateCatchEvent event) {
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    List<EventDefinition> eventDefinitions = p.getEventDefinitions();
    switch(eventDefinitions.size()) {
        case 0:
            throw new UnsupportedOperationException("An intermediate catch event should contain exactly one definition");
        case 1:
            return Match.of(EventDefinition.class, BpmnNode.class).when(TimerEventDefinition.class, e -> timerEvent(event, e)).when(SignalEventDefinition.class, e -> signalEvent(event, e)).when(MessageEventDefinition.class, e -> messageEvent(event, e)).when(ErrorEventDefinition.class, e -> errorEvent(event, e)).missing(EscalationEventDefinition.class).missing(CompensateEventDefinition.class).missing(ConditionalEventDefinition.class).apply(eventDefinitions.get(0)).value();
        default:
            throw new UnsupportedOperationException("Multiple definitions not supported for intermediate catch event");
    }
}
Also used : EventDefinition(org.eclipse.bpmn2.EventDefinition) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) BpmnNode(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) TypedFactoryManager(org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) CancellingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet) CancellingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet) 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) PropertyReaderFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.PropertyReaderFactory) List(java.util.List) SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Match(org.kie.workbench.common.stunner.bpmn.backend.converters.Match) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) CatchEvent(org.eclipse.bpmn2.CatchEvent) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Node(org.kie.workbench.common.stunner.core.graph.Node) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) BpmnNode(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode) EventDefinition(org.eclipse.bpmn2.EventDefinition) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition)

Example 2 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 linkEvent.

protected Result<BpmnNode> linkEvent(CatchEvent event) {
    String nodeId = event.getId();
    Node<View<IntermediateLinkEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateLinkEventCatching.class);
    IntermediateLinkEventCatching 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 LinkEventExecutionSet(new LinkRef(p.getLinkRef())));
    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) 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) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)

Example 3 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 messageEvent.

protected Result<BpmnNode> messageEvent(CatchEvent event, MessageEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateMessageEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateMessageEventCatching.class);
    IntermediateMessageEventCatching 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 CancellingMessageEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new MessageRef(EventDefinitionReader.messageRefOf(e), EventDefinitionReader.messageRefStructureOf(e))));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) 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) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 4 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 signalEvent.

protected Result<BpmnNode> signalEvent(CatchEvent event) {
    String nodeId = event.getId();
    Node<View<IntermediateSignalEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateSignalEventCatching.class);
    IntermediateSignalEventCatching 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 CancellingSignalEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new SignalRef(p.getSignalRef())));
    return Result.success(BpmnNode.of(node, p));
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) 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) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) CancellingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.CancellingSignalEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 5 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 timerEvent.

protected Result<BpmnNode> timerEvent(CatchEvent event, TimerEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateTimerEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateTimerEvent.class);
    IntermediateTimerEvent 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 CancellingTimerEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new TimerSettings(p.getTimerSettings(e))));
    return Result.success(BpmnNode.of(node, p));
}
Also used : TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) CancellingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.CancellingTimerEventExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) 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) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) 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