Class ConnectionFinder


  • public class ConnectionFinder
    extends java.lang.Object
    Utility methods for operating on Workflow Designer connections.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean areNodesConnected​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Node sourceNode, com.hybris.cockpitng.components.visjs.network.data.Node targetNode)
      Checks if given nodes are directly connected
      java.util.Optional<com.hybris.cockpitng.components.visjs.network.data.Edge> findActionToDecisionEdge​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, WorkflowActionTemplateModel actionModel, WorkflowDecisionTemplateModel decisionModel)
      Searches through the NetworkChart's edges, and finds the one coming from given action to given decision.
      java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findActionToDecisionEdges​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context)
      Filters all NetworkChart edges and returns only those, that come from action node and end in decision node.
      java.util.Optional<com.hybris.cockpitng.components.visjs.network.data.Edge> findDecisionToActionEdge​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, WorkflowDecisionTemplateModel decisionModel, WorkflowActionTemplateModel actionModel)
      Searches through the NetworkChart's edges, and finds the one coming from given decision to given action.
      java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findDecisionToActionEdges​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context)
      Filters all NetworkChart edges and returns only those, that come from decision node and end in action node.
      java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesFromNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Node node)
      Finds edges outgoing from node.
      java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesOfNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Node node)
      Finds all edges connected with the node (both incoming and outgoing).
      java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesToNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Node node)
      Finds edges incoming to node.
      boolean isDecisionConnectedToActionThroughAnd​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, WorkflowDecisionTemplateModel decisionModel, WorkflowActionTemplateModel actionModel)
      Checks if given decision is connected to given action through and 'And' node.
      void setNetworkEntityFinder​(NetworkEntityFinder networkEntityFinder)  
      void setNodeTypeService​(NodeTypeService nodeTypeService)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConnectionFinder

        public ConnectionFinder()
    • Method Detail

      • findActionToDecisionEdge

        public java.util.Optional<com.hybris.cockpitng.components.visjs.network.data.Edge> findActionToDecisionEdge​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                                                                                    WorkflowActionTemplateModel actionModel,
                                                                                                                    WorkflowDecisionTemplateModel decisionModel)
        Searches through the NetworkChart's edges, and finds the one coming from given action to given decision.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        actionModel - action where the edge starts
        decisionModel - decision where edge ends
        Returns:
        edge from given action to decision
      • findDecisionToActionEdge

        public java.util.Optional<com.hybris.cockpitng.components.visjs.network.data.Edge> findDecisionToActionEdge​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                                                                                    WorkflowDecisionTemplateModel decisionModel,
                                                                                                                    WorkflowActionTemplateModel actionModel)
        Searches through the NetworkChart's edges, and finds the one coming from given decision to given action.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        decisionModel - decision where the edge starts
        actionModel - action where the edge ends
        Returns:
        edge from given decision to action
      • isDecisionConnectedToActionThroughAnd

        public boolean isDecisionConnectedToActionThroughAnd​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                             WorkflowDecisionTemplateModel decisionModel,
                                                             WorkflowActionTemplateModel actionModel)
        Checks if given decision is connected to given action through and 'And' node.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        decisionModel - starting decision
        actionModel - ending action
        Returns:
        true if decision is connected to action through an 'And' node
      • findActionToDecisionEdges

        public java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findActionToDecisionEdges​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context)
        Filters all NetworkChart edges and returns only those, that come from action node and end in decision node.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        Returns:
        edges from action to decision
      • findDecisionToActionEdges

        public java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findDecisionToActionEdges​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context)
        Filters all NetworkChart edges and returns only those, that come from decision node and end in action node.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        Returns:
        edges from decision to action
      • findEdgesToNode

        public java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesToNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                                                                      com.hybris.cockpitng.components.visjs.network.data.Node node)
        Finds edges incoming to node.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        node - node for which the edges should be found
        Returns:
        edges incoming to node
      • findEdgesFromNode

        public java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesFromNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                                                                        com.hybris.cockpitng.components.visjs.network.data.Node node)
        Finds edges outgoing from node.
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        node - node for which the edges should be found
        Returns:
        edges outgoing from node
      • findEdgesOfNode

        public java.util.Set<com.hybris.cockpitng.components.visjs.network.data.Edge> findEdgesOfNode​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                                                                                      com.hybris.cockpitng.components.visjs.network.data.Node node)
        Finds all edges connected with the node (both incoming and outgoing).
        Parameters:
        context - contains Network Chart widget model, where the Workflow Designer data is stored
        node - node for which the edges should be found
        Returns:
        edges connected with node
      • areNodesConnected

        public boolean areNodesConnected​(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context,
                                         com.hybris.cockpitng.components.visjs.network.data.Node sourceNode,
                                         com.hybris.cockpitng.components.visjs.network.data.Node targetNode)
        Checks if given nodes are directly connected
        Parameters:
        context - contains the WidgetInstanceManager of the Workflow Designer
        sourceNode - Edge.fromNode of the edge
        targetNode - Edge.toNode of the edge
        Returns:
        true if nodes are directly connected
      • setNodeTypeService

        public void setNodeTypeService​(NodeTypeService nodeTypeService)
      • setNetworkEntityFinder

        public void setNetworkEntityFinder​(NetworkEntityFinder networkEntityFinder)