Search in sources :

Example 1 with BaseStartEvent

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

the class StartEventFilterProviderFactoryTest method testFilterProviderHideIsInterruptingField.

@Test
public void testFilterProviderHideIsInterruptingField() {
    BaseStartEvent[] test1Classes = { new StartNoneEvent(), new StartCompensationEvent(), new StartSignalEvent(), new StartTimerEvent(), new StartConditionalEvent(), new StartErrorEvent(), new StartEscalationEvent(), new StartMessageEvent() };
    when(parentView.getDefinition()).thenReturn(otherNode);
    Stream.of(test1Classes).forEach(catchingIntermediateEvent -> testStartEventFilterProviderHideIsInterruptingField(catchingIntermediateEvent));
    BaseStartEvent[] test2Classes = { new StartNoneEvent(), new StartCompensationEvent(), new StartErrorEvent() };
    when(parentView.getDefinition()).thenReturn(eventSubprocess);
    Stream.of(test2Classes).forEach(clazz -> testStartEventFilterProviderHideIsInterruptingField(clazz));
}
Also used : BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) StartCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent) Test(org.junit.Test)

Example 2 with BaseStartEvent

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

the class StartEventFilterProviderFactoryTest method testFilterProviderShowIsInterruptingField.

@Test
public void testFilterProviderShowIsInterruptingField() {
    BaseStartEvent[] testedClasses = { new StartSignalEvent(), new StartTimerEvent(), new StartConditionalEvent(), new StartEscalationEvent(), new StartMessageEvent() };
    when(parentView.getDefinition()).thenReturn(eventSubprocess);
    Stream.of(testedClasses).forEach(startEvent -> testStartEventFilterProviderShowIsInterruptingField(startEvent));
}
Also used : BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) Test(org.junit.Test)

Example 3 with BaseStartEvent

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

the class DefaultRouteFormProvider method findElements.

@Override
protected Collection<Pair<Object, String>> findElements(Predicate<Node> filter, Function<Node, Pair<Object, String>> mapper) {
    Node selectedNode = getSelectedElement();
    Collection<Pair<Object, String>> result = new ArrayList<>();
    if (selectedNode != null) {
        List<Edge> outEdges = selectedNode.getOutEdges();
        if (outEdges != null) {
            result = outEdges.stream().map(outEdge -> {
                String routeIdentifier = outEdge.getUUID();
                // UI value for the route is the target node name or target node type
                String targetName = null;
                String targetNodeType = null;
                BPMNDefinition bpmnDefinition = getEdgeTarget(outEdge);
                if (bpmnDefinition != null) {
                    targetNodeType = definitionManager.adapters().forDefinition().getTitle(bpmnDefinition);
                    if (bpmnDefinition instanceof BaseStartEvent || bpmnDefinition instanceof BaseCatchingIntermediateEvent || bpmnDefinition instanceof BaseThrowingIntermediateEvent || bpmnDefinition instanceof BaseEndEvent || bpmnDefinition instanceof BaseTask || bpmnDefinition instanceof BaseGateway || bpmnDefinition instanceof BaseSubprocess) {
                        targetName = bpmnDefinition.getGeneral().getName().getValue();
                    }
                }
                if (targetName != null && !targetName.isEmpty()) {
                    return new Pair<Object, String>(routeIdentifier, targetName);
                } else if (targetNodeType != null && !targetNodeType.isEmpty()) {
                    return new Pair<Object, String>(routeIdentifier, targetNodeType);
                } else {
                    return new Pair<Object, String>(routeIdentifier, routeIdentifier);
                }
            }).collect(Collectors.toList());
        }
    }
    return result;
}
Also used : BaseGateway(org.kie.workbench.common.stunner.bpmn.definition.BaseGateway) Node(org.kie.workbench.common.stunner.core.graph.Node) ArrayList(java.util.ArrayList) BaseEndEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent) BaseTask(org.kie.workbench.common.stunner.bpmn.definition.BaseTask) BaseSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseSubprocess) BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) BPMNDefinition(org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition) BaseCatchingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent) Edge(org.kie.workbench.common.stunner.core.graph.Edge) BaseThrowingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseThrowingIntermediateEvent) Pair(org.uberfire.commons.data.Pair)

Aggregations

BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)3 Test (org.junit.Test)2 StartConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent)2 StartEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent)2 StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)2 StartSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent)2 StartTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent)2 ArrayList (java.util.ArrayList)1 BPMNDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNDefinition)1 BaseCatchingIntermediateEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent)1 BaseEndEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent)1 BaseGateway (org.kie.workbench.common.stunner.bpmn.definition.BaseGateway)1 BaseSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseSubprocess)1 BaseTask (org.kie.workbench.common.stunner.bpmn.definition.BaseTask)1 BaseThrowingIntermediateEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseThrowingIntermediateEvent)1 StartCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent)1 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)1 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1