Class CircularConnectionPartialValidator

java.lang.Object
com.hybris.backoffice.workflow.designer.handler.connection.validator.CircularConnectionPartialValidator
All Implemented Interfaces:
WorkflowConnectionPartialValidator, org.springframework.core.Ordered

public class CircularConnectionPartialValidator extends Object implements WorkflowConnectionPartialValidator
Validates if created connection between action and decision does not create a circular connection. It's not possible to create both:
 decision > action
 
and:
 decision > and > action
 
connection.
  • Field Details

  • Constructor Details

    • CircularConnectionPartialValidator

      public CircularConnectionPartialValidator()
  • Method Details

    • validate

      Description copied from interface: WorkflowConnectionPartialValidator
      Validates workflow based on the ValidationContext passed
      Specified by:
      validate in interface WorkflowConnectionPartialValidator
      Parameters:
      context - context of the validation
      Returns:
      result containing potential violations
    • detectCircularConnection

      protected WorkflowConnectionValidationResult detectCircularConnection(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Edge edge)
      Checks if two nodes of added edge have circular connection via 'and' connector
      Circular connection: decision -> action, decision -> 'and' connector and 'and' connector -> action and
      Parameters:
      edge - edge that was added
      context - contains the WidgetInstanceManager of the Workflow Designer
      Returns:
      result with appropriate violation if nodes have circular connection via 'and' connector
    • detectDecisionConnectedWithActionInCircularConnection

      protected WorkflowConnectionValidationResult detectDecisionConnectedWithActionInCircularConnection(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Edge edge)
      Checks if added edge has connection from decision node to 'and' connector or from 'and' connector to action node. Then it checks again if new edge introduce circular connection via 'and' connector.
      Circular connection: decision -> action, decision -> 'and' connector and 'and' connector -> action and
      Parameters:
      edge - edge that was added
      context - contains the WidgetInstanceManager of the Workflow Designer
      Returns:
      result with appropriate violation if source Node of 'and' connector is directly connected with target Edge.toNode
    • detectNodesConnectedViaAndConnector

      protected WorkflowConnectionValidationResult detectNodesConnectedViaAndConnector(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Edge edge)
      Checks if Edge.fromNode and Edge.toNode of added edge is already connected via 'and' connector node
      Parameters:
      edge - edge that was added
      context - contains the WidgetInstanceManager of the Workflow Designer
      Returns:
      result with appropriate violation if Edge.fromNode and Edge.toNode are already connected by 'and' connector
    • getNodeTypeService

      public NodeTypeService getNodeTypeService()
    • setNodeTypeService

      public void setNodeTypeService(NodeTypeService nodeTypeService)
    • getConnectionFinder

      public ConnectionFinder getConnectionFinder()
    • setConnectionFinder

      public void setConnectionFinder(ConnectionFinder connectionFinder)
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Specified by:
      getOrder in interface WorkflowConnectionPartialValidator
    • setOrder

      public void setOrder(int order)