Interface IHierarchyValidatingNode<TData>

    • Method Detail

      • isValidChildCount

        default boolean isValidChildCount​(WorkflowNode node,
                                          int childCount)
        Checks whether the given number of children is allowed. The default implementation enforces no restriction on the number of children.
        Parameters:
        node - The parent node with the children to check.
        childCount - The number of children of the node node.
        Returns:
        true if the number of children are allowed.
      • isValidChildType

        default boolean isValidChildType​(WorkflowNode node,
                                         int childIndex,
                                         String nodeType)
        Checks whether the type of a certain workflow node child is allowed for that node. The default implementation enforces no restriction on the child type.
        Parameters:
        node - The parent node with the children to check.
        childIndex - 0-based index of the child to check.
        nodeType - Node type of the child to check.
        Returns:
        true if the child type is allowed.
      • isValidParentType

        default boolean isValidParentType​(WorkflowNode node,
                                          String nodeType)
        Checks whether the type of a certain parent is allowed for that node. The default implementation enforces no restriction on the parent type.
        Parameters:
        node - The node with the parent to check.
        nodeType - Node type of the parent to check. Empty string when the node does not have a parent.
        Returns:
        true if the parent type is allowed.
      • validateLocal

        default IWorkflowElementValidationResult validateLocal​(IElementLocalValidationParams<TData,​WorkflowNode> params)
                                                        throws WorkflowValidationException
        Description copied from interface: IElementHandler
        Performs a local validation of the given workflow workflow element properties. This method should only validate the properties of the given workflow element, without respect to any other workflow elements.

        This method allows you to implement custom validation logic. Consider using IBeanValidatingElement and annotating your properties model class with the annotation from the bean annotation API javax.validation. This also offers the advantage that it can be integrated into JSF, allowing you to use the same validations for the UI view as well.

        Specified by:
        validateLocal in interface IElementHandler<TData,​WorkflowNode>
        Parameters:
        params - The properties to validate. Also provides access to the project, client etc.
        Returns:
        The result of the validation, i.e. whether the workflow element is valid, and a list of messages to display to the user. If this returns, this is treated as if a valid result without messages had been returned. You may use use params.getValidationContext().resultBuilder() to create the result, or implement the interface yourself. To indicate that the validation was performed, but no validation constraints were violated, simply call build on the result builder and return that, without adding any messages.
        Throws:
        WorkflowValidationException - When the validation could not be performed. Please note that this is meant for unexpected errors only - you should not throw an exception if a workflow element is simply just invalid.