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 Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface com.hybris.backoffice.workflow.designer.handler.connection.validator.WorkflowConnectionPartialValidator
MEDIUM_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected WorkflowConnectionValidationResultdetectCircularConnection(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 andprotected WorkflowConnectionValidationResultdetectDecisionConnectedWithActionInCircularConnection(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.protected WorkflowConnectionValidationResultdetectNodesConnectedViaAndConnector(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Edge edge) Checks ifEdge.fromNodeandEdge.toNodeof added edge is already connected via 'and' connector nodeintgetOrder()voidsetConnectionFinder(ConnectionFinder connectionFinder) voidsetNodeTypeService(NodeTypeService nodeTypeService) voidsetOrder(int order) validate(ValidationContext context) Validates workflow based on theValidationContextpassed
-
Field Details
-
EVENT_TYPE_NODES_DIRECTLY_CONNECTED
- See Also:
-
EVENT_TYPE_ALREADY_CONNECTED_VIA_AND
- See Also:
-
-
Constructor Details
-
CircularConnectionPartialValidator
public CircularConnectionPartialValidator()
-
-
Method Details
-
validate
Description copied from interface:WorkflowConnectionPartialValidatorValidates workflow based on theValidationContextpassed- Specified by:
validatein interfaceWorkflowConnectionPartialValidator- 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 addedcontext- contains theWidgetInstanceManagerof 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 addedcontext- contains theWidgetInstanceManagerof the Workflow Designer- Returns:
- result with appropriate violation if source
Nodeof 'and' connector is directly connected with targetEdge.toNode
-
detectNodesConnectedViaAndConnector
protected WorkflowConnectionValidationResult detectNodesConnectedViaAndConnector(com.hybris.backoffice.widgets.networkchart.context.NetworkChartContext context, com.hybris.cockpitng.components.visjs.network.data.Edge edge) Checks ifEdge.fromNodeandEdge.toNodeof added edge is already connected via 'and' connector node- Parameters:
edge- edge that was addedcontext- contains theWidgetInstanceManagerof the Workflow Designer- Returns:
- result with appropriate violation if
Edge.fromNodeandEdge.toNodeare already connected by 'and' connector
-
getNodeTypeService
-
setNodeTypeService
-
getConnectionFinder
-
setConnectionFinder
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Specified by:
getOrderin interfaceWorkflowConnectionPartialValidator
-
setOrder
public void setOrder(int order)
-