Class NodeTypeService

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

public class NodeTypeService extends Object
Utility methods for operating on Workflow Designer nodes.
  • Constructor Details

    • NodeTypeService

      public NodeTypeService()
  • Method Details

    • isAction

      public boolean isAction(com.hybris.cockpitng.components.visjs.network.data.Node node)
      Checks if given node is a Workflow Action
      Parameters:
      node - node to check
      Returns:
      true if it's an Action node
    • isDecision

      public boolean isDecision(com.hybris.cockpitng.components.visjs.network.data.Node node)
      Checks if given node is a Workflow Decision
      Parameters:
      node - node to check
      Returns:
      true it it's a Decision node
    • isAnd

      public boolean isAnd(com.hybris.cockpitng.components.visjs.network.data.Node node)
      Checks if given Node is an And node
      Parameters:
      node - node to check
      Returns:
      true if it's an And node
    • isSameAction

      public boolean isSameAction(WorkflowActionTemplateModel action, com.hybris.cockpitng.components.visjs.network.data.Node node)
      Checks if given Node corresponds to the given WorkflowActionTemplateModel. For equality the following attributes are compared:
      • type
      • state (saved or unsaved)
      • code (in case of unsaved state)
      • pk (in case of saved state)
      Parameters:
      action - to be compared
      node - to be compared
      Returns:
      true if node corresponds to the given action
    • generateNodeData

      public String generateNodeData(AbstractWorkflowActionModel action)
      Generates action representation for node to be easily identified with model. For unsaved models the representation contains the type and code of action, for saved -- type, pk and persistence version.
      Parameters:
      action - to generate the node data for
      Returns:
      node data
    • isSameDecision

      public boolean isSameDecision(WorkflowDecisionTemplateModel decision, com.hybris.cockpitng.components.visjs.network.data.Node node)
      Checks if given Node corresponds to the given WorkflowDecisionTemplateModel. For equality the following attributes are compared:
      • type
      • state (saved or unsaved)
      • code (in case of unsaved state)
      • pk (in case of saved state)
      Parameters:
      decision - to be compared
      node - to be compared
      Returns:
      true if node corresponds to the given decision
    • generateNodeData

      public String generateNodeData(AbstractWorkflowDecisionModel decision)
      Generates action representation for node to be easily identified with model. For unsaved models the representation contains the type and code of decision, for saved -- type, pk and persistence version.
      Parameters:
      decision - to generate the node data for
      Returns:
      node data
    • hasCode

      public boolean hasCode(com.hybris.cockpitng.components.visjs.network.data.Node node, String code)
      Checks if node contains given code
      Parameters:
      node - that contains code to be checked
      code - code
      Returns:
      true if node contains given code, false otherwise
    • getNodeName

      public String getNodeName(com.hybris.cockpitng.components.visjs.network.data.Node node)
      Returns the node display name.
      Parameters:
      node - input node
      Returns:
      node's display name