Class WorkflowTriggerDao

    • Constructor Detail

      • WorkflowTriggerDao

        public WorkflowTriggerDao()
        Creates a new instance of this DAO. Normally you should use the singleton instance provided by DaoProvider.WORKFLOWTRIGGER_DAO.
    • Method Detail

      • getUserTriggersByRecordAndUser

        public PagedResult<WorkflowTrigger> getUserTriggersByRecordAndUser​(IEntityContext ec,
                                                                           UUID formRecordUuid,
                                                                           IUser user,
                                                                           int page,
                                                                           int pageSize)
        Description copied from interface: IWorkflowTriggerDao
        Finds the portal workflow triggers available for the form record given by its UUID if the given user can access the form record.
        Specified by:
        getUserTriggersByRecordAndUser in interface IWorkflowTriggerDao
        Parameters:
        ec - entity context for accessing the database.
        formRecordUuid - the UUID of the form record
        user - to get the portal workflow triggers for.
        page - to get.
        pageSize - size of the page to get.
        Returns:
        a list of portal workflow triggers the user has access to ordered by their name (asc). null if the form record given by the UUID could not be found.
      • getUserTriggerByRecordAndUser

        public WorkflowTrigger getUserTriggerByRecordAndUser​(IEntityContext ec,
                                                             IUser user,
                                                             UUID formRecordUuid,
                                                             UUID taskUuid,
                                                             UUID triggerUuid)
        Description copied from interface: IWorkflowTriggerDao
        Returns the workflow user trigger defined by the given record, task and trigger UUID. The workflow trigger needs to be of type USER.
        Specified by:
        getUserTriggerByRecordAndUser in interface IWorkflowTriggerDao
        Parameters:
        ec - entity context for accessing the database.
        user - to get the user workflow trigger for.
        formRecordUuid - the UUID of the form record.
        taskUuid - the UUID of the workflow task.
        triggerUuid - the UUID of the workflow trigger.
        Returns:
        the workflow user trigger defined by the given record, task and trigger UUID. null if no workflow trigger was found with the given specification.
      • byUuid

        public TElement byUuid​(IEntityContext ec,
                               long processId,
                               UUID taskUuid,
                               UUID nodeUuid)
        Specified by:
        byUuid in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        processId - ID of a WorkflowProcess.
        taskUuid - UUID of the task to which the element belongs.
        nodeUuid - UUID of the workflow element.
        Returns:
        The workflow element with the given UUID, or null when no such element exists.
      • getAllReferencingElements

        public List<TElement> getAllReferencingElements​(IEntityContext ec,
                                                        Mandant client,
                                                        de.xima.cmn.dao.interfaces.IEntity<Long> entity)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow elements within the client that reference the given entity .
        Specified by:
        getAllReferencingElements in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        client - Client to which to limit the search.
        entity - Entity to search for.
        Returns:
        All workflow elements within the given scope that reference the given entity.
      • getAllReferencingElements

        public List<TElement> getAllReferencingElements​(IEntityContext ec,
                                                        Projekt project,
                                                        de.xima.cmn.dao.interfaces.IEntity<Long> entity)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow elements within the project that reference the given entity .
        Specified by:
        getAllReferencingElements in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        project - Project to which to limit the search.
        entity - Entity to search for.
        Returns:
        All workflow elements within the given scope that reference the given entity.
      • getAllReferencingElements

        public List<TElement> getAllReferencingElements​(IEntityContext ec,
                                                        WorkflowVersion version,
                                                        de.xima.cmn.dao.interfaces.IEntity<Long> entity)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow elements within the version that reference the given entity .
        Specified by:
        getAllReferencingElements in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        version - Version to which to limit the search.
        entity - Entity to search for.
        Returns:
        All workflow elements within the given scope that reference the given entity.
      • getForActiveVersionBy

        public List<TElement> getForActiveVersionBy​(IEntityContext ec,
                                                    Projekt project,
                                                    de.xima.cmn.criteria.FilterCriterion requestedFilter)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow element entities matching the given filter criterion on a AWorkflowElement. Restricts the result to the triggers of the Projekt.getActiveWorkflowVersion().
        Specified by:
        getForActiveVersionBy in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        project - Project to which to restrict the result. Must not be null, or an empty list is returned.
        requestedFilter - Filter criterion on a AWorkflowElement. May contain sub criteria. If null, it is treated as a filter that always matches.
        Returns:
        All workflow elements that are part of the active workflow version of the given project, and match the given filter criterion. If project is null, returns an empty list.
      • getForActiveVersionBy

        public List<TElement> getForActiveVersionBy​(IEntityContext ec,
                                                    Projekt project,
                                                    String type,
                                                    List<SearchTerm> searchTerms)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow element of the given type and with the given search terms. Restricts the result to the triggers of the Projekt.getActiveWorkflowVersion().
        Specified by:
        getForActiveVersionBy in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        project - Project to which to restrict the result. Must not be null, or an empty list is returned.
        type - AWorkflowElement.getType() of the workflow elements to find. When null or empty, no type filter is applied.
        searchTerms - Search terms to match. The workflow element must match all of the given terms (the search terms are combined with AND). When null or empty, no search term filter is applied.
        Returns:
        A list of all matching workflow elements that are part of the active workflow version of the given project.
      • getForCurrentVersionBy

        public List<TElement> getForCurrentVersionBy​(IEntityContext ec,
                                                     Vorgang formRecord,
                                                     de.xima.cmn.criteria.FilterCriterion requestedFilter)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow element entities matching the given filter criterion on a AWorkflowElement. Restricts the result to the triggers of the Vorgang.getWorkflowVersion().
        Specified by:
        getForCurrentVersionBy in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        formRecord - Form record to which to restrict the result. Must not be null, or an empty list is returned. The result is restricted to the Vorgang.getWorkflowVersion().
        requestedFilter - Filter criterion on a AWorkflowElement. May contain sub criteria. If null, it is treated as a filter that always matches.
        Returns:
        All workflow elements that are part of the workflow version of the given form record, and match the given filter criterion. If formRecord is null, returns an empty list.
      • getForCurrentVersionBy

        public List<TElement> getForCurrentVersionBy​(IEntityContext ec,
                                                     Vorgang formRecord,
                                                     String type,
                                                     List<SearchTerm> searchTerms)
        Description copied from interface: IWorkflowElementDao
        Finds all workflow element of the given type and with the given search terms. Restricts the result to the triggers of the Vorgang.getWorkflowVersion().
        Specified by:
        getForCurrentVersionBy in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        ec - Current entity context.
        formRecord - Form record to which to restrict the result. Must not be null, or an empty list is returned. The result is restricted to the Vorgang.getWorkflowVersion().
        type - AWorkflowElement.getType() of the workflow elements to find. When null or empty, no type filter is applied.
        searchTerms - Search terms to match. The workflow element must match all of the given terms (the search terms are combined with AND). When null or empty, no search term filter is applied.
        Returns:
        A list of all matching workflow elements that are part of the workflow version of the given form record.
      • searchTermExists

        public de.xima.cmn.criteria.FilterCriterion searchTermExists​(String key,
                                                                     de.xima.cmn.criteria.FilterCriterion... moreFilters)
        Specified by:
        searchTermExists in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        key - Key of the search term.
        moreFilters - Additional filter the search term must match. Root for property paths is AWorkflowElementSearchTerm.
        Returns:
        A filter criterion that matches when there exists at least one search term with the given key that also matches the additional given filters. Must be used with a query for WorkflowTrigger or WorkflowNode.
      • searchTermExists

        public de.xima.cmn.criteria.FilterCriterion searchTermExists​(String key,
                                                                     String value)
        Specified by:
        searchTermExists in interface IWorkflowElementDao<TElement extends IWorkflowElementEntity & de.xima.cmn.dao.interfaces.IEntity<Long>>
        Parameters:
        key - Key of the search term.
        value - Value of the search term.
        Returns:
        A filter criterion that evaluates to true when this trigger has a search term matching the given key and value. Must be used with a query for WorkflowTrigger or WorkflowNode.