Interface ConstraintContext

  • All Superinterfaces:
    Serializable

    public interface ConstraintContext
    extends Serializable
    The context in which constraints are executed.
    • Method Detail

      • constraintsSatisfied

        boolean constraintsSatisfied()
        Are all constraints satisfied? Only valid after a call to execute().
        Returns:
        true if all constraints are satisfied, false otherwise.
      • getConstraintViolations

        List<ConstraintViolatedException> getConstraintViolations()
        Get a list of constraint violations. Will return an empty list if there are no violations. Only valid after a call to execute().
        Returns:
        a list of ConstraintViolatedException objects representing violations or an empty list for no violations.
      • getViolationException

        ConstraintViolatedException getViolationException()
        Get the first constraint violation. Only valid after a call to execute().
        Returns:
        the first violation, or null if there are no violations.
      • getLOV

        LOVCollection getLOV​(Locale locale,
                             String parameterName,
                             String query,
                             int startAt,
                             int fetchSize)
        Get an LOV for the specified parameter.
        Parameters:
        locale - the locale for the LOV.
        parameterName - the name of the parameter for which an LOV is required.
        query - a user specified query.
        startAt - the starting position for the query results.
        fetchSize - the fetch size for the query results.
        Returns:
        an LOVCollection representing the results.
      • getLOVSupport

        LOVSupport getLOVSupport​(String parameterName)
        Does this constraint provide LOV support for the specified parameter?
        Parameters:
        parameterName - the name of the parameter for which an LOV is required.
        Returns:
        an LOVSupport object representing the level of LOV support provided by this constraint for the specified parameter.
      • getConstraintEntity

        ConstraintEntity getConstraintEntity()
        Get a representation of the entity to use for constraint evaluation. This representation may wrap:
        • a real Job
        • a JobChainCall if the constraint is being evaluated in the job chain editor
        • a row in a Table if the constraint is being evaluated in the context of a table
        Returns:
        a representation of the entity to use for constraint evaluation.
      • isAllowedQueue

        boolean isAllowedQueue​(Queue queue)
        Do the constraints allow this queue to be used for this entity?
        Parameters:
        queue - the queue in question
        Returns:
        true if the queue is allowed, false otherwise.
      • isAllowedForcedProcessServer

        boolean isAllowedForcedProcessServer​(ProcessServer processServer)
        Do the constraints allow this process server to be used for this entity?
        Parameters:
        processServer - the process server in question
        Returns:
        true if the process server is allowed, false otherwise.
      • applyRouting

        void applyRouting​(boolean isQueueInherited)
        Do the constraints allow routing to be used in a chain for this entity?
        Parameters:
        isQueueInherited - is the queue set by the user or inherited from it's parent
      • getIsolationGroup

        String getIsolationGroup()
        Get the isolation group for this constraint context.
        Returns:
        the isolation group of the session for this constraint context.
      • getDisplayValue

        String getDisplayValue​(String parameterName,
                               Object value)
        Calculate the display value for the given internal value.
        Parameters:
        parameterName -
        value -
        Returns:
        String
      • getInternalValue

        String getInternalValue​(String parameterName,
                                String query)
        Find the internal value for the given search string for a display value. Only returns the internal value if there is only one match. It does not need to be an exact match. If there are no matches, the constant string NO_OBJECTS_FOUND is returned. If there is more than one match, the constant string TOO_MANY_OBJECTS is returned.
        Parameters:
        parameterName - for which the internal value is requested
        query - is a search string for the display value
        Returns:
        the internal value of the object that matches the query, or a fixed string if the query does not match a single object
      • update

        void update​(String parameterName,
                    String changedParameterName)
        Notifies constraint about parameter changes.
        Parameters:
        parameterName -
        changedParameterName -