Interface ActivityInstanceService

    • Method Detail

      • getActivitiesWithStates

        java.util.List<SActivityInstance> getActivitiesWithStates​(long rootContainerId,
                                                                  java.util.Set<java.lang.Integer> stateIds,
                                                                  int fromIndex,
                                                                  int maxResults,
                                                                  java.lang.String sortingField,
                                                                  OrderByType sortingOrder)
                                                           throws SActivityReadException
        Get activities with specific states in the root container in specific order, this is used for pagination
        Parameters:
        rootContainerId - identifier of root container, it always is process definition id
        fromIndex - Index of the record to be retrieved from. First record has index 0
        maxResults - Number of result we want to get. Maximum number of result returned
        sortingField - the field used to do order
        sortingOrder - ASC or DESC
        stateIds - Identifiers of states
        Returns:
        a list of SActivityInstance objects
        Throws:
        SActivityReadException
      • getPendingTasks

        java.util.List<SHumanTaskInstance> getPendingTasks​(long userId,
                                                           java.util.Set<java.lang.Long> actorIds,
                                                           int fromIndex,
                                                           int maxResults,
                                                           java.lang.String sortFieldName,
                                                           OrderByType order)
                                                    throws SActivityReadException
        Get pending tasks for the user in specific actors. This is used for pagination
        Parameters:
        userId - identifier of user
        actorIds - identifiers of actor
        fromIndex - Index of the record to be retrieved from. First record has index 0
        maxResults - Number of result we want to get. Maximum number of result returned
        sortFieldName - the field used to do order
        order - ASC or DESC
        Returns:
        a list of SActivityInstance objects
        Throws:
        SActivityReadException
      • getAssignedUserTasks

        java.util.List<SHumanTaskInstance> getAssignedUserTasks​(long userId,
                                                                int fromIndex,
                                                                int maxResults,
                                                                java.lang.String sortFieldName,
                                                                OrderByType order)
                                                         throws SActivityReadException
        Get tasks assigned to the user. This is used for pagination
        Parameters:
        userId - identifier of user
        fromIndex - Index of the record to be retrieved from. First record has index 0
        maxResults - Number of result we want to get. Maximum number of result returned
        sortFieldName - the field used to do order
        order - ASC or DESC
        Returns:
        a list of SHumanTaskInstance objects
        Throws:
        SActivityReadException
      • getArchivedActivityInstances

        java.util.List<SAActivityInstance> getArchivedActivityInstances​(long rootContainerId,
                                                                        QueryOptions queryOptions)
                                                                 throws SActivityReadException
        Get archived activity instances in the specific root container.
        Parameters:
        rootContainerId - identifier of root container, the root container can be process instance
        queryOptions - a map of specific parameters of a query
        Returns:
        a list of SAActivityInstance objects
        Throws:
        SActivityReadException
      • getNumberOfOpenActivityInstances

        int getNumberOfOpenActivityInstances​(long processInstanceId)
                                      throws SActivityReadException
        Get total number of open activity instances for the specific process instance
        Parameters:
        processInstanceId - identifier of process instance
        Returns:
        the number of opened activity instances in the specific process instance
        Throws:
        SActivityReadException
      • getOpenActivityInstances

        java.util.List<SActivityInstance> getOpenActivityInstances​(long rootContainerId,
                                                                   int pageIndex,
                                                                   int maxResults,
                                                                   java.lang.String sortingField,
                                                                   OrderByType orderbyType)
                                                            throws SActivityReadException
        Get all open activity instances in the specific process instance. This is used for pagination
        Parameters:
        rootContainerId - identifier of root container, the root container can be process instance
        pageIndex - the page index to indicate which page will be retrieved. First page has index 0
        maxResults - Number of result we want to get. Maximum number of result returned
        sortingField - the field used to do order
        orderbyType - ASC or DESC
        Returns:
        a list of SActivityInstance objects
        Throws:
        SActivityReadException
      • getActivityInstances

        java.util.List<SActivityInstance> getActivityInstances​(long rootContainerId,
                                                               int fromIndex,
                                                               int numberOfResults)
                                                        throws SActivityReadException
        Get all activity instances for the specific process instance
        Parameters:
        rootContainerId - identifier of root container, the root container can be process instance
        Returns:
        a list of SActivityInstance objects
        Throws:
        SActivityReadException
      • getChildrenOfAnActivity

        java.util.List<SActivityInstance> getChildrenOfAnActivity​(long parentActivityInstanceId,
                                                                  int fromIndex,
                                                                  int numberOfResults)
                                                           throws SActivityReadException
        Get all child instances for the specific parent activity instance, order by id ascending.
        Parameters:
        parentActivityInstanceId - identifier of parent activity instance
        fromIndex - Index of the record to be retrieved from. First record has index 0
        numberOfResults - TODO
        Returns:
        a list of SActivityInstance objects
        Throws:
        SActivityReadException
      • getNumberOfAssignedHumanTaskInstances

        long getNumberOfAssignedHumanTaskInstances​(long userId)
                                            throws SActivityReadException
        Get the number of UserTask instances assigned to a specific user
        Parameters:
        userId - the id of the user concerned
        Returns:
        the number of UserTask instances assigned to this specific user
        Throws:
        SActivityReadException - if a Read exception occurs
      • getNumberOfAssignedTasksSupervisedBy

        long getNumberOfAssignedTasksSupervisedBy​(long supervisorId,
                                                  QueryOptions queryOptions)
                                           throws SBonitaReadException
        Search UserTask instances assigned for a specific supervisor
        Parameters:
        parameters - a map of specific parameters of a query
        parameters - a map of specific parameters of a query
        Returns:
        the number of UserTask assigned to this specific supervisor
        Throws:
        SActivityReadException - if a Read exception occurs
        SBonitaReadException
      • getNumberOfArchivedHumanTasksSupervisedBy

        long getNumberOfArchivedHumanTasksSupervisedBy​(long supervisorId,
                                                       QueryOptions queryOptions)
                                                throws SBonitaReadException
        Search AUserTask instances archived for a specific supervisor
        Parameters:
        queryOptions - the object used to manage all the search parameters of a query
        parameters - a map of specific parameters of a query
        Returns:
        the number of UserTask archived to this specific supervisor
        Throws:
        SActivityReadException - if a Read exception occurs
        SBonitaReadException
      • searchAssignedTasksSupervisedBy

        java.util.List<SHumanTaskInstance> searchAssignedTasksSupervisedBy​(long supervisorId,
                                                                           QueryOptions queryOptions)
                                                                    throws SBonitaReadException
        Search UserTask instances assigned for a specific supervisor
        Parameters:
        queryOptions - the object used to manage all the search parameters of a query
        parameters - a map of specific parameters of a query
        Returns:
        the UserTask instances list assigned to this specific supervisor
        Throws:
        SActivityReadException - if a Read exception occurs
        SBonitaReadException
      • searchArchivedHumanTasksSupervisedBy

        java.util.List<SAHumanTaskInstance> searchArchivedHumanTasksSupervisedBy​(long supervisorId,
                                                                                 QueryOptions queryOptions)
                                                                          throws SBonitaReadException
        Search AUserTask instances archived for a specific supervisor
        Parameters:
        queryOptions - the object used to manage all the search parameters of a query
        parameters - a map of specific parameters of a query
        Returns:
        the UserTask instances list archived to this specific supervisor
        Throws:
        SActivityReadException - if a Read exception occurs
        SBonitaReadException
      • searchArchivedTasks

        java.util.List<SAHumanTaskInstance> searchArchivedTasks​(QueryOptions searchOptions)
                                                         throws SBonitaReadException
        Search archived human tasks according to specific search criteria
        Parameters:
        searchOptions - the object used to manage all the search parameters of a query
        persistenceService - used to retrieve the archived tasks
        Returns:
        a list of SAHumanTaskInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfArchivedTasks

        long getNumberOfArchivedTasks​(QueryOptions searchOptions)
                               throws SBonitaReadException
        Get total number of archived tasks according to specific search criteria
        Parameters:
        searchOptions - the object used to manage all the search parameters of a query
        persistenceService - used to retrieve the archived tasks
        Returns:
        Throws:
        SBonitaReadException
      • getNumberOfAssignedTasksManagedBy

        long getNumberOfAssignedTasksManagedBy​(long managerUserId,
                                               QueryOptions searchOptions)
                                        throws SBonitaReadException
        Get total number of assigned tasks managed by the specific manager
        Parameters:
        managerUserId - identifier of manager user
        searchOptions - the object used to manage all the search parameters of a query
        Returns:
        number of assigned tasks managed by the specific manager
        Throws:
        SBonitaReadException
      • searchAssignedTasksManagedBy

        java.util.List<SHumanTaskInstance> searchAssignedTasksManagedBy​(long managerUserId,
                                                                        QueryOptions searchOptions)
                                                                 throws SBonitaReadException
        Get all assigned tasks managed by the specific manager
        Parameters:
        managerUserId - identifier of manager user
        searchOptions - the object used to manage all the search parameters of a query
        Returns:
        a list of SHumanTaskInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfArchivedTasksManagedBy

        long getNumberOfArchivedTasksManagedBy​(long managerUserId,
                                               QueryOptions searchOptions)
                                        throws SBonitaReadException
        get the total number of archived tasks assigned to subordinates of specified manager.
        Parameters:
        managerUserId - the userId of the manager
        searchOptions - the search options to paginate, filter, ...
        Returns:
        the number of elements encountered
        Throws:
        SBonitaReadException - in case a search error occurs
      • searchArchivedTasksManagedBy

        java.util.List<SAHumanTaskInstance> searchArchivedTasksManagedBy​(long managerUserId,
                                                                         QueryOptions searchOptions)
                                                                  throws SBonitaReadException
        get the archived tasks assigned to subordinates of specified manager, limited to, sorted, paginated with the specifies QueryOptions
        Parameters:
        managerUserId - the userId of the manager
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        the elements encountered matching the specified options
        Throws:
        SBonitaReadException - in case a search error occurs
      • searchPendingTasksSupervisedBy

        java.util.List<SHumanTaskInstance> searchPendingTasksSupervisedBy​(long userId,
                                                                          QueryOptions searchOptions)
                                                                   throws SBonitaReadException
        Search all pending human task instances for the specific supervisor
        Parameters:
        userId - identifier of supervisor user
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        a list of SHumanTaskInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfPendingTasksSupervisedBy

        long getNumberOfPendingTasksSupervisedBy​(long userId,
                                                 QueryOptions queryOptions)
                                          throws SBonitaReadException
        Get total number of pending human task instances for the specific supervisor
        Parameters:
        userId - identifier of supervisor user
        queryOptions - the search options to paginate, filter, sort ...
        Returns:
        number of pending human task instances for the specific supervisor
        Throws:
        SBonitaReadException
      • getNumberOfHumanTasks

        long getNumberOfHumanTasks​(QueryOptions queryOptions)
                            throws SBonitaReadException
        Get number of human task instances according to the criteria
        Parameters:
        queryOptions - the search options to paginate, filter, sort ...
        Returns:
        number of human task instances satisfied to the criteria
        Throws:
        SBonitaReadException
      • getNumberOfOpenTasksForUsers

        java.util.Map<java.lang.Long,​java.lang.Long> getNumberOfOpenTasksForUsers​(java.util.List<java.lang.Long> userIds)
                                                                                 throws SBonitaReadException
        Get number of open tasks for each user
        Parameters:
        userIds - identifiers of users
        Returns:
        a map containing user id and corresponding task number
        Throws:
        SBonitaReadException
      • searchNumberOfPendingTasksManagedBy

        long searchNumberOfPendingTasksManagedBy​(long managerUserId,
                                                 QueryOptions searchOptions)
                                          throws SBonitaReadException
        Search total number of pending tasks for the specific manager
        Parameters:
        managerUserId - identifier of manager user
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        number of pending tasks
        Throws:
        SBonitaReadException
      • searchPendingTasksManagedBy

        java.util.List<SHumanTaskInstance> searchPendingTasksManagedBy​(long managerUserId,
                                                                       QueryOptions searchOptions)
                                                                throws SBonitaReadException
        Search all pending tasks for the specific manager
        Parameters:
        managerUserId - identifier of manager user
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        a list of SHumanTaskInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfOverdueOpenTasksForUsers

        java.util.Map<java.lang.Long,​java.lang.Long> getNumberOfOverdueOpenTasksForUsers​(java.util.List<java.lang.Long> userIds)
                                                                                        throws SBonitaReadException
        Get number of overdue open tasks for each user
        Parameters:
        userIds - identifiers of users
        Returns:
        a map containing userId and corresponding number of tasks
        Throws:
        SBonitaReadException
      • addMultiInstanceNumberOfTerminatedActivities

        void addMultiInstanceNumberOfTerminatedActivities​(SMultiInstanceActivityInstance flowNodeInstance,
                                                          int number)
                                                   throws SActivityModificationException
        Add number of terminated activeInstances for the specific SMultiInstanceActivityInstance object
        Parameters:
        flowNodeInstance - an SMultiInstanceActivityInstance object
        number - will be added to terminated instances of flowNodeInstance the number will be added
        Throws:
        SActivityModificationException
      • addMultiInstanceNumberOfCompletedActivities

        void addMultiInstanceNumberOfCompletedActivities​(SMultiInstanceActivityInstance flowNodeInstance,
                                                         int number)
                                                  throws SActivityModificationException
        Add number of completed activeInstances for the specific SMultiInstanceActivityInstance object
        Parameters:
        flowNodeInstance - an SMultiInstanceActivityInstance object whose completed activity number will be updated
        number - the number will be added
        Throws:
        SActivityModificationException
      • getNumberOfActivityInstances

        long getNumberOfActivityInstances​(java.lang.Class<? extends PersistentObject> entityClass,
                                          QueryOptions searchOptions)
                                   throws SBonitaReadException
        Get total number of activity instances for the specific entity class
        Parameters:
        entityClass - to indicate which type of class will be retrieved
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        number of activity instances for the specific entity class
        Throws:
        SBonitaReadException
      • searchActivityInstances

        java.util.List<SActivityInstance> searchActivityInstances​(java.lang.Class<? extends PersistentObject> entityClass,
                                                                  QueryOptions searchOptions)
                                                           throws SBonitaReadException
        Search all activity instances for the specific entity class
        Parameters:
        entityClass - to indicate which type of class will be retrieved
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        a list of SActivityInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfArchivedActivityInstances

        long getNumberOfArchivedActivityInstances​(java.lang.Class<? extends PersistentObject> entityClass,
                                                  QueryOptions searchOptions)
                                           throws SBonitaReadException
        Get total number of archived activity instances for the specific entity class
        Parameters:
        entityClass - to indicate which type of class will be retrieved
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        number of archived activity instances for the specific entity class
        Throws:
        SBonitaReadException
      • searchArchivedActivityInstances

        java.util.List<SAActivityInstance> searchArchivedActivityInstances​(java.lang.Class<? extends PersistentObject> entityClass,
                                                                           QueryOptions searchOptions)
                                                                    throws SBonitaReadException
        Search all archived activity instances for the specific entity class
        Parameters:
        entityClass - to indicate which type of class will be retrieved
        searchOptions - the search options to paginate, filter, sort ...
        Returns:
        a list of SAActivityInstance objects
        Throws:
        SBonitaReadException
      • getNumberOfPendingOrAssignedOrAssignedToOthersTasks

        long getNumberOfPendingOrAssignedOrAssignedToOthersTasks​(long userId,
                                                                 QueryOptions searchOptions)
                                                          throws SBonitaReadException
        Parameters:
        userId -
        searchOptions -
        Returns:
        Throws:
        SBonitaReadException
        Since:
        7.15
      • getPossibleUserIdsOfPendingTasks

        java.util.List<java.lang.Long> getPossibleUserIdsOfPendingTasks​(long humanTaskInstanceId,
                                                                        int startIndex,
                                                                        int maxResults)
                                                                 throws SActivityReadException
        Throws:
        SActivityReadException
      • getNumberOfUsersWhoCanExecutePendingHumanTaskDeploymentInfo

        long getNumberOfUsersWhoCanExecutePendingHumanTaskDeploymentInfo​(long humanTaskInstanceId,
                                                                         QueryOptions searchOptions)
                                                                  throws SBonitaReadException
        Get total number of users according to specific query options, and who can start the task filtered with the search option of the given process definition
        Parameters:
        searchOptions - The QueryOptions object containing some query conditions
        Returns:
        Throws:
        SBonitaReadException
      • searchUsersWhoCanExecutePendingHumanTaskDeploymentInfo

        java.util.List<SUser> searchUsersWhoCanExecutePendingHumanTaskDeploymentInfo​(long humanTaskInstanceId,
                                                                                     QueryOptions searchOptions)
                                                                              throws SBonitaReadException
        Search the users according to specific query options, and who can start the task filtered with the search option of the given process definition
        Parameters:
        searchOptions - The QueryOptions object containing some query conditions
        Returns:
        Throws:
        SBonitaReadException
      • getNumberOfAssignedAndPendingHumanTasksFor

        long getNumberOfAssignedAndPendingHumanTasksFor​(long rootProcessDefinitionId,
                                                        long userId,
                                                        QueryOptions queryOptions)
                                                 throws SBonitaReadException
        Get the total number of the assigned and pending human tasks for the specified user, on the specified root process definition, corresponding to the options.
        Parameters:
        rootProcessDefinitionId - The identifier of the root process definition
        userId - The identifier of the user
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        6.3.3
      • searchAssignedAndPendingHumanTasksFor

        java.util.List<SHumanTaskInstance> searchAssignedAndPendingHumanTasksFor​(long rootProcessDefinitionId,
                                                                                 long userId,
                                                                                 QueryOptions queryOptions)
                                                                          throws SBonitaReadException
        Search the assigned and pending human tasks for the specified user, on the specified root process definition, corresponding to the options.
        Parameters:
        rootProcessDefinitionId - The identifier of the root process definition
        userId - The identifier of the user
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        6.3.3
      • getNumberOfAssignedAndPendingHumanTasks

        long getNumberOfAssignedAndPendingHumanTasks​(long rootProcessDefinitionId,
                                                     QueryOptions queryOptions)
                                              throws SBonitaReadException
        Get the total number of the assigned and pending human tasks for any user, on the specified root process definition, corresponding to the options.
        Parameters:
        rootProcessDefinitionId - The identifier of the root process definition
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        6.3.3
      • searchAssignedAndPendingHumanTasks

        java.util.List<SHumanTaskInstance> searchAssignedAndPendingHumanTasks​(long rootProcessDefinitionId,
                                                                              QueryOptions queryOptions)
                                                                       throws SBonitaReadException
        Search the assigned and pending human tasks for any user, on the specified root process definition, corresponding to the options.
        Parameters:
        rootProcessDefinitionId - The identifier of the root process definition
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        6.3.3
      • getNumberOfAssignedAndPendingHumanTasks

        long getNumberOfAssignedAndPendingHumanTasks​(QueryOptions queryOptions)
                                              throws SBonitaReadException
        Get the total number of the assigned and pending human tasks for any user corresponding to the options.
        Parameters:
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        7.6.1
      • searchAssignedAndPendingHumanTasks

        java.util.List<SHumanTaskInstance> searchAssignedAndPendingHumanTasks​(QueryOptions queryOptions)
                                                                       throws SBonitaReadException
        Search the assigned and pending human tasks for any user corresponding to the options.
        Parameters:
        queryOptions - The search conditions and the options for sorting and paging the results.
        Returns:
        The assigned and pending human tasks
        Throws:
        SBonitaReadException
        Since:
        7.6.1