Class ConnectionFinder

java.lang.Object
com.hybris.backoffice.workflow.designer.services.ConnectionFinder

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    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
    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.
    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.
    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.
    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.
    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.
    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).
    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
     
    void
     

    Methods inherited from class java.lang.Object

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

    • ConnectionFinder

      public ConnectionFinder()
  • Method Details

    • findActionToDecisionEdge

      public 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 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 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 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 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 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 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)