Search in sources :

Example 16 with Edge

use of org.kie.workbench.common.stunner.core.graph.Edge in project kie-wb-common by kiegroup.

the class StartEventConverter method timerEvent.

private BpmnNode timerEvent(StartEvent event, TimerEventDefinition e) {
    Node<View<StartTimerEvent>, Edge> node = factoryManager.newNode(event.getId(), StartTimerEvent.class);
    StartTimerEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new InterruptingTimerEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), new TimerSettings(p.getTimerSettings(e))));
    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 : InterruptingTimerEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet) TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) 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 17 with Edge

use of org.kie.workbench.common.stunner.core.graph.Edge in project kie-wb-common by kiegroup.

the class StartEventConverter method messageEvent.

private BpmnNode messageEvent(StartEvent event, MessageEventDefinition e) {
    Node<View<StartMessageEvent>, Edge> node = factoryManager.newNode(event.getId(), StartMessageEvent.class);
    StartMessageEvent 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 InterruptingMessageEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), new MessageRef(e.getMessageRef().getName())));
    definition.setSimulationSet(p.getSimulationSet());
    node.getContent().setBounds(p.getBounds());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    return BpmnNode.of(node);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) 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) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) 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 18 with Edge

use of org.kie.workbench.common.stunner.core.graph.Edge in project kie-wb-common by kiegroup.

the class StartEventConverter method noneEvent.

private BpmnNode noneEvent(StartEvent event) {
    Node<View<StartNoneEvent>, Edge> node = factoryManager.newNode(event.getId(), StartNoneEvent.class);
    StartNoneEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setIsInterrupting(new IsInterrupting(event.isIsInterrupting()));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) 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 19 with Edge

use of org.kie.workbench.common.stunner.core.graph.Edge 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 20 with Edge

use of org.kie.workbench.common.stunner.core.graph.Edge in project kie-wb-common by kiegroup.

the class StartEventConverter method signalEvent.

private BpmnNode signalEvent(StartEvent event, SignalEventDefinition e) {
    Node<View<StartSignalEvent>, Edge> node = factoryManager.newNode(event.getId(), StartSignalEvent.class);
    StartSignalEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new InterruptingSignalEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), new SignalRef(p.getSignalRef())));
    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 : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet) 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)

Aggregations

Edge (org.kie.workbench.common.stunner.core.graph.Edge)154 View (org.kie.workbench.common.stunner.core.graph.content.view.View)101 Node (org.kie.workbench.common.stunner.core.graph.Node)84 Test (org.junit.Test)45 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)30 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)30 Graph (org.kie.workbench.common.stunner.core.graph.Graph)28 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)25 RuleViolation (org.kie.workbench.common.stunner.core.rule.RuleViolation)25 Point2D (org.kie.workbench.common.stunner.core.graph.content.view.Point2D)19 ViewConnector (org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector)19 List (java.util.List)17 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)16 Bounds (org.kie.workbench.common.stunner.core.graph.content.Bounds)16 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)15 Element (org.kie.workbench.common.stunner.core.graph.Element)14 BoundImpl (org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl)13 Child (org.kie.workbench.common.stunner.core.graph.content.relationship.Child)12 BoundsImpl (org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl)12 ArrayList (java.util.ArrayList)11