Class CaseRuntimeDataServiceImpl

    • Constructor Detail

      • CaseRuntimeDataServiceImpl

        public CaseRuntimeDataServiceImpl()
    • Method Detail

      • setCaseIdGenerator

        public void setCaseIdGenerator​(CaseIdGenerator caseIdGenerator)
      • setRuntimeDataService

        public void setRuntimeDataService​(RuntimeDataService runtimeDataService)
      • setCaseService

        public void setCaseService​(CaseService caseService)
      • setIdentityProvider

        public void setIdentityProvider​(org.kie.internal.identity.IdentityProvider identityProvider)
      • setUserGroupCallback

        public void setUserGroupCallback​(org.kie.api.task.UserGroupCallback userGroupCallback)
      • setDeploymentRolesManager

        public void setDeploymentRolesManager​(DeploymentRolesManager deploymentRolesManager)
      • getCase

        public CaseDefinition getCase​(String deploymentId,
                                      String caseDefinitionId)
        Description copied from interface: CaseRuntimeDataService
        Returns case definition identified by caseDefinitionId that belongs to given deploymentId.
        Specified by:
        getCase in interface CaseRuntimeDataService
        Parameters:
        deploymentId - deployment identifier that case definition is part of
        caseDefinitionId - id of the case
      • getCases

        public Collection<CaseDefinition> getCases​(String filter,
                                                   org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns available cases which matching filter that applies to case name (usually represented by process id or name).
        Specified by:
        getCases in interface CaseRuntimeDataService
        Parameters:
        filter - filter for case name to narrow down results
        queryContext - control parameters for the result e.g. sorting, paging
      • getCasesByDeployment

        public Collection<CaseDefinition> getCasesByDeployment​(String deploymentId,
                                                               org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns available cases for given deployment id
        Specified by:
        getCasesByDeployment in interface CaseRuntimeDataService
        Parameters:
        deploymentId - deployment identifier that case definition is part of
        queryContext - control parameters for the result e.g. sorting, paging
      • getProcessDefinitions

        public Collection<ProcessDefinition> getProcessDefinitions​(String filter,
                                                                   org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns process definitions that are not considered as case definitions and are filtered by process id or name.
        Specified by:
        getProcessDefinitions in interface CaseRuntimeDataService
        Parameters:
        filter - regex based filter for either name or id of the process
        queryContext - control parameters for the result e.g. sorting, paging
      • getProcessDefinitionsByDeployment

        public Collection<ProcessDefinition> getProcessDefinitionsByDeployment​(String deploymentId,
                                                                               org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns process definitions that are not considered as case definitions that belongs to given deployment.
        Specified by:
        getProcessDefinitionsByDeployment in interface CaseRuntimeDataService
        Parameters:
        deploymentId - deployment id the processes should be found for
        queryContext - control parameters for the result e.g. sorting, paging
      • getProcessInstancesForCase

        public Collection<ProcessInstanceDesc> getProcessInstancesForCase​(String caseId,
                                                                          List<Integer> processStates,
                                                                          org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns process instances found for given case id.
        Specified by:
        getProcessInstancesForCase in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        processStates - states representing process instance (active, completed, aborted)
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstanceMilestones

        public Collection<CaseMilestoneInstance> getCaseInstanceMilestones​(String caseId,
                                                                           boolean achievedOnly,
                                                                           org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns milestones for given case instance, identified by case id.
        Specified by:
        getCaseInstanceMilestones in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        achievedOnly - filter option to return only these that have already been achieved
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstanceStages

        public Collection<CaseStageInstance> getCaseInstanceStages​(String caseId,
                                                                   boolean activeOnly,
                                                                   org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns stages of given case instance, identified by case id.
        Specified by:
        getCaseInstanceStages in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        activeOnly - filter option to return only stages that are active
        queryContext - control parameters for the result e.g. sorting, paging
      • getActiveNodesForCase

        public Collection<NodeInstanceDesc> getActiveNodesForCase​(String caseId,
                                                                  org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns active nodes in given case regardless in what process instance they belong to.
        Specified by:
        getActiveNodesForCase in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        queryContext - control parameters for the result e.g. sorting, paging
      • getCompletedNodesForCase

        public Collection<NodeInstanceDesc> getCompletedNodesForCase​(String caseId,
                                                                     org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns completed nodes in given case regardless in what process instance they belong to.
        Specified by:
        getCompletedNodesForCase in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstances

        public Collection<CaseInstance> getCaseInstances​(boolean withData,
                                                         org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances
        Specified by:
        getCaseInstances in interface CaseRuntimeDataService
        Parameters:
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstances

        public Collection<CaseInstance> getCaseInstances​(List<CaseStatus> statuses,
                                                         org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses
        Specified by:
        getCaseInstances in interface CaseRuntimeDataService
        Parameters:
        statuses - list of statuses that case should be in to match
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstances

        public Collection<CaseInstance> getCaseInstances​(List<CaseStatus> statuses,
                                                         boolean withData,
                                                         org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses
        Specified by:
        getCaseInstances in interface CaseRuntimeDataService
        Parameters:
        statuses - list of statuses that case should be in to match
        withData - indicates if case file information should be included in returned instances
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDeployment

        public Collection<CaseInstance> getCaseInstancesByDeployment​(String deploymentId,
                                                                     List<CaseStatus> statuses,
                                                                     org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available case instances;
        Specified by:
        getCaseInstancesByDeployment in interface CaseRuntimeDataService
        Parameters:
        deploymentId - deployment identifier that case instance is part of
        statuses - list of statuses that case should be in to match
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDeployment

        public Collection<CaseInstance> getCaseInstancesByDeployment​(String deploymentId,
                                                                     List<CaseStatus> statuses,
                                                                     boolean withData,
                                                                     org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available case instances;
        Specified by:
        getCaseInstancesByDeployment in interface CaseRuntimeDataService
        Parameters:
        deploymentId - deployment identifier that case instance is part of
        statuses - list of statuses that case should be in to match
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDefinition

        public Collection<CaseInstance> getCaseInstancesByDefinition​(String definitionId,
                                                                     List<CaseStatus> statuses,
                                                                     boolean withData,
                                                                     org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available case instances;
        Specified by:
        getCaseInstancesByDefinition in interface CaseRuntimeDataService
        Parameters:
        definitionId - case definition id
        statuses - list of statuses that case should be in to match
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesOwnedBy

        public Collection<CaseInstance> getCaseInstancesOwnedBy​(String owner,
                                                                List<CaseStatus> statuses,
                                                                boolean withData,
                                                                org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all case instances owned by given user
        Specified by:
        getCaseInstancesOwnedBy in interface CaseRuntimeDataService
        Parameters:
        owner - user owning task
        statuses - list of statuses that case should be in to match
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByRole

        public Collection<CaseInstance> getCaseInstancesByRole​(String roleName,
                                                               List<CaseStatus> statuses,
                                                               org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns cases instances that given user (via identity provider) has access to with given role.
        Specified by:
        getCaseInstancesByRole in interface CaseRuntimeDataService
        Parameters:
        roleName - name of the role that user should be
        statuses - statuses of the case instances
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByRole

        public Collection<CaseInstance> getCaseInstancesByRole​(String roleName,
                                                               List<CaseStatus> statuses,
                                                               boolean withData,
                                                               org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns cases instances that given user (via identity provider) has access to with given role.
        Specified by:
        getCaseInstancesByRole in interface CaseRuntimeDataService
        Parameters:
        roleName - name of the role that user should be
        statuses - statuses of the case instances
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesAnyRole

        public Collection<CaseInstance> getCaseInstancesAnyRole​(List<CaseStatus> statuses,
                                                                org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns case instances that given user (via identity provider) is involved in in any role.
        Specified by:
        getCaseInstancesAnyRole in interface CaseRuntimeDataService
        Parameters:
        statuses - statuses of the case instances
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesAnyRole

        public Collection<CaseInstance> getCaseInstancesAnyRole​(List<CaseStatus> statuses,
                                                                boolean withData,
                                                                org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns case instances that given user (via identity provider) is involved in in any role.
        Specified by:
        getCaseInstancesAnyRole in interface CaseRuntimeDataService
        Parameters:
        statuses - statuses of the case instances
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDataItem

        public Collection<CaseInstance> getCaseInstancesByDataItem​(String dataItemName,
                                                                   List<CaseStatus> statuses,
                                                                   org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses and has case file data item with given name
        Specified by:
        getCaseInstancesByDataItem in interface CaseRuntimeDataService
        Parameters:
        dataItemName - name of the case file data item
        statuses - list of statuses that case should be in to match
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDataItem

        public Collection<CaseInstance> getCaseInstancesByDataItem​(String dataItemName,
                                                                   List<CaseStatus> statuses,
                                                                   boolean withData,
                                                                   org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses and has case file data item with given name
        Specified by:
        getCaseInstancesByDataItem in interface CaseRuntimeDataService
        Parameters:
        dataItemName - name of the case file data item
        statuses - list of statuses that case should be in to match
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDataItemAndValue

        public Collection<CaseInstance> getCaseInstancesByDataItemAndValue​(String dataItemName,
                                                                           String dataItemValue,
                                                                           List<CaseStatus> statuses,
                                                                           org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses and has case file data item with given name and value
        Specified by:
        getCaseInstancesByDataItemAndValue in interface CaseRuntimeDataService
        Parameters:
        dataItemName - name of the case file data item
        dataItemValue - expected value of the data item
        statuses - list of statuses that case should be in to match
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstancesByDataItemAndValue

        public Collection<CaseInstance> getCaseInstancesByDataItemAndValue​(String dataItemName,
                                                                           String dataItemValue,
                                                                           List<CaseStatus> statuses,
                                                                           boolean withData,
                                                                           org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all available active case instances that match given statuses and has case file data item with given name and value
        Specified by:
        getCaseInstancesByDataItemAndValue in interface CaseRuntimeDataService
        Parameters:
        dataItemName - name of the case file data item
        dataItemValue - expected value of the data item
        statuses - list of statuses that case should be in to match
        withData - indicates if case file data should be included in the result
        queryContext - control parameters for the result e.g. sorting, paging
      • getCaseInstanceById

        public CaseInstance getCaseInstanceById​(String caseId)
        Description copied from interface: CaseRuntimeDataService
        Returns case instance for given case id if the caller of this class is authorized to see the case instance
        Specified by:
        getCaseInstanceById in interface CaseRuntimeDataService
        Parameters:
        caseId - unique case id of the case
        Returns:
        case instance with basic details or null in case it was not found or access was not granted
      • getCaseTasksAssignedAsPotentialOwner

        public List<org.kie.api.task.model.TaskSummary> getCaseTasksAssignedAsPotentialOwner​(String caseId,
                                                                                             String userId,
                                                                                             List<org.kie.api.task.model.Status> status,
                                                                                             org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all tasks associated with given case id that are eligible for user to see.
        Specified by:
        getCaseTasksAssignedAsPotentialOwner in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        userId - user id that the tasks should be available for
        status - status of the task
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of tasks found for given case id and user
      • getCaseTasksAssignedAsBusinessAdmin

        public List<org.kie.api.task.model.TaskSummary> getCaseTasksAssignedAsBusinessAdmin​(String caseId,
                                                                                            String userId,
                                                                                            List<org.kie.api.task.model.Status> status,
                                                                                            org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all tasks associated with given case id that are eligible for user to see as business admin role.
        Specified by:
        getCaseTasksAssignedAsBusinessAdmin in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        userId - user id that the tasks should be available for
        status - status of the task
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of tasks found for given case id and user
      • getCaseTasksAssignedAsStakeholder

        public List<org.kie.api.task.model.TaskSummary> getCaseTasksAssignedAsStakeholder​(String caseId,
                                                                                          String userId,
                                                                                          List<org.kie.api.task.model.Status> status,
                                                                                          org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns all tasks associated with given case id that are eligible for user to see in task stakeholder role.
        Specified by:
        getCaseTasksAssignedAsStakeholder in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        userId - user id that the tasks should be available for
        status - status of the task
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of tasks found for given case id and user
      • getActiveNodesForCaseAndStage

        protected Collection<NodeInstanceDesc> getActiveNodesForCaseAndStage​(String caseId,
                                                                             String stageId,
                                                                             org.kie.api.runtime.query.QueryContext queryContext)
      • applyQueryContext

        protected void applyQueryContext​(Map<String,​Object> params,
                                         org.kie.api.runtime.query.QueryContext queryContext)
      • applyDeploymentFilter

        protected void applyDeploymentFilter​(Map<String,​Object> params)
      • adoptList

        protected List<?> adoptList​(List<?> source,
                                    List<?> values)
      • collectUserAuthInfo

        protected List<String> collectUserAuthInfo()
      • applyPagination

        protected <T> Collection<T> applyPagination​(List<T> input,
                                                    org.kie.api.runtime.query.QueryContext queryContext)
      • getCaseInstanceDataItems

        public Collection<CaseFileItem> getCaseInstanceDataItems​(String caseId,
                                                                 org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns case file data items (as simple descriptions not actual values) for given case instance
        Specified by:
        getCaseInstanceDataItems in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of found case file data items
      • getCaseInstanceDataItemsByName

        public Collection<CaseFileItem> getCaseInstanceDataItemsByName​(String caseId,
                                                                       List<String> names,
                                                                       org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns case file data items (as simple descriptions not actual values) for given case instance filtered by item names
        Specified by:
        getCaseInstanceDataItemsByName in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        names - name of data items to be found
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of found case file data items
      • getCaseInstanceDataItemsByType

        public Collection<CaseFileItem> getCaseInstanceDataItemsByType​(String caseId,
                                                                       List<String> types,
                                                                       org.kie.api.runtime.query.QueryContext queryContext)
        Description copied from interface: CaseRuntimeDataService
        Returns case file data items (as simple descriptions not actual values) for given case instance filtered by item types
        Specified by:
        getCaseInstanceDataItemsByType in interface CaseRuntimeDataService
        Parameters:
        caseId - unique id of the case
        types - type of data items to be found
        queryContext - control parameters for the result e.g. sorting, paging
        Returns:
        list of found case file data items