Package org.jbpm.casemgmt.impl
Class CaseServiceImpl
- java.lang.Object
-
- org.jbpm.casemgmt.impl.CaseServiceImpl
-
- All Implemented Interfaces:
CaseService
public class CaseServiceImpl extends Object implements CaseService
-
-
Constructor Summary
Constructors Constructor Description CaseServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddCaseComment(String caseId, String author, String comment, String... restrictedTo)Adds new comment to the casevoidaddDataToCaseFile(String caseId, String name, Object value, String... restrictedTo)Adds given named value into case file of given case.voidaddDataToCaseFile(String caseId, Map<String,Object> data, String... restrictedTo)Adds complete map to case file of given case.LongaddDynamicSubprocess(Long processInstanceId, String processId, Map<String,Object> parameters)Adds new subprocess (identified by process id) to case.LongaddDynamicSubprocess(String caseId, String processId, Map<String,Object> parameters)Adds new subprocess (identified by process id) to given process instance.LongaddDynamicSubprocessToStage(Long processInstanceId, String stage, String processId, Map<String,Object> parameters)Adds new subprocess (identified by process id) to case.LongaddDynamicSubprocessToStage(String caseId, String stage, String processId, Map<String,Object> parameters)Adds new subprocess (identified by process id) to given process instance.voidaddDynamicTask(Long processInstanceId, TaskSpecification taskSpecification)Adds new user task to specified process instance.voidaddDynamicTask(String caseId, TaskSpecification taskSpecification)Adds new user task to specified case.voidaddDynamicTaskToStage(Long processInstanceId, String stage, TaskSpecification taskSpecification)Adds new user task to specified case and stage on given process instance.voidaddDynamicTaskToStage(String caseId, String stage, TaskSpecification taskSpecification)Adds new user task to specified case and stage.voidassignToCaseRole(String caseId, String role, org.kie.api.task.model.OrganizationalEntity entity)Assigns given entity (user or group) to case role for a given case.voidcancelCase(String caseId)Cancels case with given case id (including all attached process instances if any).voidcloseCase(String caseId, String comment)Closes case with given case id (including all attached process instances if any).voiddestroyCase(String caseId)Permanently destroys case identified by given case id.Collection<CommentInstance>getCaseComments(String caseId, CommentSortBy sortBy, org.kie.api.runtime.query.QueryContext queryContext)Returns all case comments sorted with given sortByCollection<CommentInstance>getCaseComments(String caseId, org.kie.api.runtime.query.QueryContext queryContext)Returns all case comments sorted by dateprotected CaseEventSupportgetCaseEventSupport(String deploymentId)CaseFileInstancegetCaseFileInstance(String caseId)Returns Case file for give case idCaseInstancegetCaseInstance(String caseId)Returns case instance (only if it's active) identified by given case id - does not load case file, roles, milestones nor stages.CaseInstancegetCaseInstance(String caseId, boolean withData, boolean withRoles, boolean withMilestones, boolean withStages)Returns case instance (only if it's active) identified by given case id with options on what should be fetchedCollection<CaseRoleInstance>getCaseRoleAssignments(String caseId)Returns role assignments for given caseprotected CaseFileInstanceinternalGetCaseFileInstance(String caseId, String deploymentId)protected voidinternalTriggerAdHocFragment(ProcessInstanceDesc pi, String fragmentName, Object data)protected booleanisEmpty(Collection<?> data)CaseFileInstancenewCaseFileInstance(String deploymentId, String caseDefinition, Map<String,Object> data)Builds and returns new CaseFileInstance with given data.CaseFileInstancenewCaseFileInstance(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,org.kie.api.task.model.OrganizationalEntity> rolesAssignment)Builds and returns new CaseFileInstance with given data and roles assignments.CaseFileInstancenewCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,List<String>> accessRestrictions)Builds and returns new CaseFileInstance with given data.CaseFileInstancenewCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,org.kie.api.task.model.OrganizationalEntity> rolesAssignment, Map<String,List<String>> accessRestrictions)Builds and returns new CaseFileInstance with given data and roles assignments.org.kie.api.task.model.GroupnewGroup(String groupId)Creates new group with given id;TaskSpecificationnewHumanTaskSpec(String taskName, String description, String actorIds, String groupIds, Map<String,Object> parameters)Returns new TaskSpecification describing user task so it can be created as dynamic task.TaskSpecificationnewTaskSpec(String nodeType, String nodeName, Map<String,Object> parameters)Returns new TaskSpecification describing generic (work item based) task so it can be added as dynamic task.org.kie.api.task.model.UsernewUser(String userId)Creates new user with given id;voidremoveCaseComment(String caseId, String commentId)Removes given comment from the case comments listvoidremoveDataFromCaseFile(String caseId, String name)Removes given variable (stored under name) from case file of given case.voidremoveDataFromCaseFile(String caseId, List<String> variableNames)Removes given variables (stored under variableNames) from case file of given case.voidremoveFromCaseRole(String caseId, String role, org.kie.api.task.model.OrganizationalEntity entity)Removes given entity (user or group) from the case role for a given case.voidreopenCase(String caseId, String deploymentId, String caseDefinitionId)Reopens case given by case id by starting another instance of case definition.voidreopenCase(String caseId, String deploymentId, String caseDefinitionId, Map<String,Object> data)Reopens case given by case id by starting another instance of case definition.voidsetAuthorizationManager(AuthorizationManager authorizationManager)voidsetCaseIdGenerator(CaseIdGenerator caseIdGenerator)voidsetCaseRuntimeDataService(CaseRuntimeDataService caseRuntimeDataService)voidsetCommandService(TransactionalCommandService commandService)voidsetDeploymentService(DeploymentService deploymentService)voidsetIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)voidsetProcessService(ProcessService processService)voidsetRuntimeDataService(RuntimeDataService runtimeDataService)StringstartCase(String deploymentId, String caseDefinitionId)Starts a new case for given definition with empty case file.StringstartCase(String deploymentId, String caseDefinitionId, CaseFileInstance caseFile)Starts a new case for given definition with given case file.voidtriggerAdHocFragment(Long processInstanceId, String fragmentName, Object data)Triggers given by fragmentName adhoc element (such as task, milestone) within given process instancevoidtriggerAdHocFragment(Long processInstanceId, String stage, String fragmentName, Object data)Triggers given by fragmentName adhoc element (such as task, milestone) within given process instance and stagevoidtriggerAdHocFragment(String caseId, String fragmentName, Object data)Triggers given by fragmentName adhoc element (such as task, milestone) within given case.voidtriggerAdHocFragment(String caseId, String stage, String fragmentName, Object data)Triggers given by fragmentName adhoc element (such as task, milestone) within given case and stage.voidupdateCaseComment(String caseId, String commentId, String author, String text, String... restrictedTo)Updated given comment with entire text providedprotected ProcessInstanceDescverifyCaseIdExisted(String caseId)protected ProcessInstanceDescverifyCaseIdExists(String caseId)
-
-
-
Method Detail
-
setProcessService
public void setProcessService(ProcessService processService)
-
setRuntimeDataService
public void setRuntimeDataService(RuntimeDataService runtimeDataService)
-
setDeploymentService
public void setDeploymentService(DeploymentService deploymentService)
-
setCaseRuntimeDataService
public void setCaseRuntimeDataService(CaseRuntimeDataService caseRuntimeDataService)
-
setCaseIdGenerator
public void setCaseIdGenerator(CaseIdGenerator caseIdGenerator)
-
setCommandService
public void setCommandService(TransactionalCommandService commandService)
-
setAuthorizationManager
public void setAuthorizationManager(AuthorizationManager authorizationManager)
-
setIdentityProvider
public void setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)
-
startCase
public String startCase(String deploymentId, String caseDefinitionId)
Description copied from interface:CaseServiceStarts a new case for given definition with empty case file.
Case id is generated based on case id prefix (defined on case definition) and generated value.
CASE-XXXXXXXXXwhereXXXXXXXis generated value for the prefix
Examples:- CASE-0000000123
- HR-0000000321
- LOAN-0000000099
- Specified by:
startCasein interfaceCaseService- Parameters:
deploymentId- deployment id of project that case definition belongs tocaseDefinitionId- id of case definition- Returns:
- returns unique case id in the format PREFIX-GENERATED_ID as described above
-
startCase
public String startCase(String deploymentId, String caseDefinitionId, CaseFileInstance caseFile)
Description copied from interface:CaseServiceStarts a new case for given definition with given case file.
Case id is generated based on case id prefix (defined on case definition) and generated value.
CASE-XXXXXXXXXwhereXXXXXXXis generated value for the prefix
Examples:- CASE-0000000123
- HR-0000000321
- LOAN-0000000099
- Specified by:
startCasein interfaceCaseService- Parameters:
deploymentId- deployment id of project that case definition belongs tocaseDefinitionId- id of case definitioncaseFile- initial case file to be used for this case- Returns:
- returns unique case id in the format PREFIX-GENERATED_ID as described above
-
getCaseFileInstance
public CaseFileInstance getCaseFileInstance(String caseId) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns Case file for give case id- Specified by:
getCaseFileInstancein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Returns:
- returns current snapshot of CaseFileInstance
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
getCaseInstance
public CaseInstance getCaseInstance(String caseId) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns case instance (only if it's active) identified by given case id - does not load case file, roles, milestones nor stages. UseCaseService.getCaseInstance(String, boolean, boolean, boolean, boolean)for more advanced fetch options.- Specified by:
getCaseInstancein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Returns:
- returns current snapshot of CaseInstance
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
getCaseInstance
public CaseInstance getCaseInstance(String caseId, boolean withData, boolean withRoles, boolean withMilestones, boolean withStages) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns case instance (only if it's active) identified by given case id with options on what should be fetched- Specified by:
getCaseInstancein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodwithData- determines if case file should be loadedwithRoles- determines if role assignments should be loadedwithMilestones- determines if milestones should be loadedwithStages- determines with stages should be loaded- Returns:
- returns current snapshot of CaseInstance
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
closeCase
public void closeCase(String caseId, String comment) throws CaseNotFoundException
Description copied from interface:CaseServiceCloses case with given case id (including all attached process instances if any). Does not affect case file so in case it can still be used to reopen the case by starting new instances.- Specified by:
closeCasein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
cancelCase
public void cancelCase(String caseId) throws CaseNotFoundException
Description copied from interface:CaseServiceCancels case with given case id (including all attached process instances if any). Does not affect case file so in case it can still be used to reopen the case by starting new instances.- Specified by:
cancelCasein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
destroyCase
public void destroyCase(String caseId) throws CaseNotFoundException
Description copied from interface:CaseServicePermanently destroys case identified by given case id. It performs the same operation as abortCase and destroys the case file and other attached information.- Specified by:
destroyCasein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
reopenCase
public void reopenCase(String caseId, String deploymentId, String caseDefinitionId) throws CaseNotFoundException
Description copied from interface:CaseServiceReopens case given by case id by starting another instance of case definition. It will inherit all data from case file that was available in before case was closed/canceled.- Specified by:
reopenCasein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methoddeploymentId- deployment id of project that case definition belongs tocaseDefinitionId- id of case definition- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
reopenCase
public void reopenCase(String caseId, String deploymentId, String caseDefinitionId, Map<String,Object> data) throws CaseNotFoundException
Description copied from interface:CaseServiceReopens case given by case id by starting another instance of case definition. It will inherit all data from case file that was available in before case was closed/canceled.- Specified by:
reopenCasein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methoddeploymentId- deployment id of project that case definition belongs tocaseDefinitionId- id of case definitiondata- additional data to be set on case file- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDynamicTask
public void addDynamicTask(String caseId, TaskSpecification taskSpecification) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new user task to specified case. Should be used when user task should be added to the main process instance of the case. If there are more process instances for given case and user task should be added to specific process instanceCaseService.addDynamicTask(Long, TaskSpecification)should be used- Specified by:
addDynamicTaskin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodtaskSpecification- complete specification that defines the type of a task to be added- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDynamicTask
public void addDynamicTask(Long processInstanceId, TaskSpecification taskSpecification) throws ProcessInstanceNotFoundException
Description copied from interface:CaseServiceAdds new user task to specified process instance.- Specified by:
addDynamicTaskin interfaceCaseService- Parameters:
processInstanceId- unique process instance idtaskSpecification- complete specification that defines the type of a task to be added- Throws:
ProcessInstanceNotFoundException
-
addDynamicTaskToStage
public void addDynamicTaskToStage(String caseId, String stage, TaskSpecification taskSpecification) throws CaseNotFoundException, StageNotFoundException
Description copied from interface:CaseServiceAdds new user task to specified case and stage. Should be used when user task should be added to the main process instance of the case. If there are more process instances for given case and user task should be added to specific process instanceCaseService.addDynamicTaskToStage(Long, String, TaskSpecification)should be used- Specified by:
addDynamicTaskToStagein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodstage- id or name of the stage there the task should be addedtaskSpecification- complete specification that defines the type of a task to be added- Throws:
CaseNotFoundException- thrown in case case was not found with given idStageNotFoundException- thrown in case stage does not exist
-
addDynamicTaskToStage
public void addDynamicTaskToStage(Long processInstanceId, String stage, TaskSpecification taskSpecification) throws CaseNotFoundException, StageNotFoundException
Description copied from interface:CaseServiceAdds new user task to specified case and stage on given process instance.- Specified by:
addDynamicTaskToStagein interfaceCaseService- Parameters:
processInstanceId- unique process instance idstage- id or name of the stage there the task should be addedtaskSpecification- complete specification that defines the type of a task to be added- Throws:
CaseNotFoundException- thrown in case case was not found with given idStageNotFoundException- thrown in case stage does not exist
-
addDynamicSubprocess
public Long addDynamicSubprocess(String caseId, String processId, Map<String,Object> parameters) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new subprocess (identified by process id) to given process instance. Should be used when subprocess should be added to the main process instance of the case. If there are more process instances for given case and subprocess should be added to specific process instance- Specified by:
addDynamicSubprocessin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodprocessId- identifier of the process to be addedparameters- optional parameters for the subprocess- Returns:
- returns process instance id of the subprocess
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDynamicSubprocess
public Long addDynamicSubprocess(Long processInstanceId, String processId, Map<String,Object> parameters) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new subprocess (identified by process id) to case.- Specified by:
addDynamicSubprocessin interfaceCaseService- Parameters:
processInstanceId- unique process instance idprocessId- identifier of the process to be addedparameters- optional parameters for the subprocess- Returns:
- returns process instance id of the subprocess
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDynamicSubprocessToStage
public Long addDynamicSubprocessToStage(String caseId, String stage, String processId, Map<String,Object> parameters) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new subprocess (identified by process id) to given process instance. Should be used when subprocess should be added to the main process instance of the case. If there are more process instances for given case and subprocess should be added to specific process instance- Specified by:
addDynamicSubprocessToStagein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodCaseService.addDynamicSubprocess(Long, String, Map)method should be used instead.stage- id or name of the stage there the task should be addedprocessId- identifier of the process to be addedparameters- optional parameters for the subprocess- Returns:
- returns process instance id of the subprocess
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDynamicSubprocessToStage
public Long addDynamicSubprocessToStage(Long processInstanceId, String stage, String processId, Map<String,Object> parameters) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new subprocess (identified by process id) to case.- Specified by:
addDynamicSubprocessToStagein interfaceCaseService- Parameters:
processInstanceId- unique process instance idstage- id or name of the stage there the task should be addedprocessId- identifier of the process to be addedparameters- optional parameters for the subprocess- Returns:
- returns process instance id of the subprocess
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
triggerAdHocFragment
public void triggerAdHocFragment(String caseId, String fragmentName, Object data) throws CaseNotFoundException
Description copied from interface:CaseServiceTriggers given by fragmentName adhoc element (such as task, milestone) within given case. Should be used when fragment should be triggered on the main process instance of the case. If there are more process instances for given case and fragment should be triggered on specific process instanceCaseService.triggerAdHocFragment(Long, String, Object)method should be used instead- Specified by:
triggerAdHocFragmentin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodfragmentName- name of the element that can be triggereddata- optional data to be given when triggering the node- Throws:
CaseNotFoundException
-
triggerAdHocFragment
public void triggerAdHocFragment(Long processInstanceId, String fragmentName, Object data) throws CaseNotFoundException
Description copied from interface:CaseServiceTriggers given by fragmentName adhoc element (such as task, milestone) within given process instance- Specified by:
triggerAdHocFragmentin interfaceCaseService- Parameters:
processInstanceId- unique process instance idfragmentName- name of the element that can be triggereddata- optional data to be given when triggering the node- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
triggerAdHocFragment
public void triggerAdHocFragment(String caseId, String stage, String fragmentName, Object data) throws CaseNotFoundException
Description copied from interface:CaseServiceTriggers given by fragmentName adhoc element (such as task, milestone) within given case and stage. Should be used when fragment should be triggered on the main process instance of the case. If there are more process instances for given case and fragment should be triggered on specific process instanceCaseService.triggerAdHocFragment(Long, String, String, Object)method should be used instead- Specified by:
triggerAdHocFragmentin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodstage- id or name of the stage there the task should be addedfragmentName- name of the element that can be triggereddata- optional data to be given when triggering the node- Throws:
CaseNotFoundException
-
triggerAdHocFragment
public void triggerAdHocFragment(Long processInstanceId, String stage, String fragmentName, Object data) throws CaseNotFoundException
Description copied from interface:CaseServiceTriggers given by fragmentName adhoc element (such as task, milestone) within given process instance and stage- Specified by:
triggerAdHocFragmentin interfaceCaseService- Parameters:
processInstanceId- unique process instance idstage- id or name of the stage there the task should be addedfragmentName- name of the element that can be triggereddata- optional data to be given when triggering the node- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDataToCaseFile
public void addDataToCaseFile(String caseId, String name, Object value, String... restrictedTo) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds given named value into case file of given case.- Specified by:
addDataToCaseFilein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodname- unique name for given value to be put into case filevalue- actual value to be added to case filerestrictedTo- optional case roles that this data should be restricted to- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addDataToCaseFile
public void addDataToCaseFile(String caseId, Map<String,Object> data, String... restrictedTo) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds complete map to case file of given case. Replaces any existing value that is registered under same name.- Specified by:
addDataToCaseFilein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methoddata- key value representing data to be added to case filerestrictedTo- optional case roles that this data should be restricted to- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
removeDataFromCaseFile
public void removeDataFromCaseFile(String caseId, String name) throws CaseNotFoundException
Description copied from interface:CaseServiceRemoves given variable (stored under name) from case file of given case.- Specified by:
removeDataFromCaseFilein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodname- variable name that should be removed from case file- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
removeDataFromCaseFile
public void removeDataFromCaseFile(String caseId, List<String> variableNames) throws CaseNotFoundException
Description copied from interface:CaseServiceRemoves given variables (stored under variableNames) from case file of given case.- Specified by:
removeDataFromCaseFilein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodvariableNames- list of variables to be removed from the case file- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
assignToCaseRole
public void assignToCaseRole(String caseId, String role, org.kie.api.task.model.OrganizationalEntity entity) throws CaseNotFoundException
Description copied from interface:CaseServiceAssigns given entity (user or group) to case role for a given case. Case roles can be used for user task assignments.- Specified by:
assignToCaseRolein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodrole- name of the role entity should be assigned toentity- user or group to be assigned to given role- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
removeFromCaseRole
public void removeFromCaseRole(String caseId, String role, org.kie.api.task.model.OrganizationalEntity entity) throws CaseNotFoundException
Description copied from interface:CaseServiceRemoves given entity (user or group) from the case role for a given case.- Specified by:
removeFromCaseRolein interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodrole- name of the role entity should be assigned toentity- entity user or group to be assigned to given role- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
getCaseRoleAssignments
public Collection<CaseRoleInstance> getCaseRoleAssignments(String caseId) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns role assignments for given case- Specified by:
getCaseRoleAssignmentsin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Returns:
- returns collection of all currently defined role assignments of the given case
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
getCaseComments
public Collection<CommentInstance> getCaseComments(String caseId, org.kie.api.runtime.query.QueryContext queryContext) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns all case comments sorted by date- Specified by:
getCaseCommentsin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase method- Returns:
- returns all comments added to given case
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
getCaseComments
public Collection<CommentInstance> getCaseComments(String caseId, CommentSortBy sortBy, org.kie.api.runtime.query.QueryContext queryContext) throws CaseNotFoundException
Description copied from interface:CaseServiceReturns all case comments sorted with given sortBy- Specified by:
getCaseCommentsin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodsortBy- defines how to sort comments- Returns:
- sorted comments
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
addCaseComment
public String addCaseComment(String caseId, String author, String comment, String... restrictedTo) throws CaseNotFoundException
Description copied from interface:CaseServiceAdds new comment to the case- Specified by:
addCaseCommentin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodauthor- author of the commentcomment- actual comment (text)restrictedTo- optional case roles that this data should be restricted to- Returns:
- unique id of the comment that has been added
- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
updateCaseComment
public void updateCaseComment(String caseId, String commentId, String author, String text, String... restrictedTo) throws CaseNotFoundException
Description copied from interface:CaseServiceUpdated given comment with entire text provided- Specified by:
updateCaseCommentin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodcommentId- unique id of the commentauthor- author of the commenttext- updated text of the commentrestrictedTo- optional case roles that this data should be restricted to- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
removeCaseComment
public void removeCaseComment(String caseId, String commentId) throws CaseNotFoundException
Description copied from interface:CaseServiceRemoves given comment from the case comments list- Specified by:
removeCaseCommentin interfaceCaseService- Parameters:
caseId- unique case id in the format PREFIX-GENERATED_ID as described on startCase methodcommentId- unique id of the comment- Throws:
CaseNotFoundException- thrown in case case was not found with given id
-
newCaseFileInstance
public CaseFileInstance newCaseFileInstance(String deploymentId, String caseDefinition, Map<String,Object> data)
Description copied from interface:CaseServiceBuilds and returns new CaseFileInstance with given data. Not yet associated with any case- Specified by:
newCaseFileInstancein interfaceCaseService- Parameters:
deploymentId- deployment that case belongs tocaseDefinition- id of the case definition to be able to properly setup case filedata- initial data for case file- Returns:
- returns new instance (not associated with case) of CaseFileInstance populated with given data
-
newCaseFileInstanceWithRestrictions
public CaseFileInstance newCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,List<String>> accessRestrictions)
Description copied from interface:CaseServiceBuilds and returns new CaseFileInstance with given data. Not yet associated with any case- Specified by:
newCaseFileInstanceWithRestrictionsin interfaceCaseService- Parameters:
deploymentId- deployment that case belongs tocaseDefinition- id of the case definition to be able to properly setup case filedata- initial data for case fileaccessRestrictions- access restrictions to data that defines what case roles are allowed to add and manipulate given data- Returns:
- returns new instance (not associated with case) of CaseFileInstance populated with given data
-
newCaseFileInstance
public CaseFileInstance newCaseFileInstance(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,org.kie.api.task.model.OrganizationalEntity> rolesAssignment)
Description copied from interface:CaseServiceBuilds and returns new CaseFileInstance with given data and roles assignments. Not yet associated with any case- Specified by:
newCaseFileInstancein interfaceCaseService- Parameters:
deploymentId- deployment that case belongs tocaseDefinition- id of the case definition to be able to properly setup case filedata- initial data for case filerolesAssignment- initial role assignment- Returns:
- returns new instance (not associated with case) of CaseFileInstance populated with given data
-
newCaseFileInstanceWithRestrictions
public CaseFileInstance newCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String,Object> data, Map<String,org.kie.api.task.model.OrganizationalEntity> rolesAssignment, Map<String,List<String>> accessRestrictions)
Description copied from interface:CaseServiceBuilds and returns new CaseFileInstance with given data and roles assignments. Not yet associated with any case- Specified by:
newCaseFileInstanceWithRestrictionsin interfaceCaseService- Parameters:
deploymentId- deployment that case belongs tocaseDefinition- id of the case definition to be able to properly setup case filedata- initial data for case filerolesAssignment- initial role assignmentaccessRestrictions- access restrictions to data that defines what case roles are allowed to add and manipulate given data- Returns:
- returns new instance (not associated with case) of CaseFileInstance populated with given data
-
newHumanTaskSpec
public TaskSpecification newHumanTaskSpec(String taskName, String description, String actorIds, String groupIds, Map<String,Object> parameters)
Description copied from interface:CaseServiceReturns new TaskSpecification describing user task so it can be created as dynamic task. All string based attributes support variable expressions (#{variable-name})- Specified by:
newHumanTaskSpecin interfaceCaseService- Parameters:
taskName- - mandatory name of the taskdescription- - optional description of the taskactorIds- - optional list (comma separated) of actors to be assignedgroupIds- - optional list (comma separated) of groups to be assignedparameters- - optional parameters (task inputs)- Returns:
-
newTaskSpec
public TaskSpecification newTaskSpec(String nodeType, String nodeName, Map<String,Object> parameters)
Description copied from interface:CaseServiceReturns new TaskSpecification describing generic (work item based) task so it can be added as dynamic task.- Specified by:
newTaskSpecin interfaceCaseService- Parameters:
nodeType- - type of a node (same as used for registering work item handler)nodeName- - name of the node to be assigned on taskparameters- - optional parameters (task inputs)- Returns:
-
newUser
public org.kie.api.task.model.User newUser(String userId)
Description copied from interface:CaseServiceCreates new user with given id;- Specified by:
newUserin interfaceCaseService- Parameters:
userId- user id to be used when creating User instance- Returns:
- new instance for userId
-
newGroup
public org.kie.api.task.model.Group newGroup(String groupId)
Description copied from interface:CaseServiceCreates new group with given id;- Specified by:
newGroupin interfaceCaseService- Parameters:
groupId- group id to be used when creating Group instance- Returns:
- new instance for groupId
-
internalGetCaseFileInstance
protected CaseFileInstance internalGetCaseFileInstance(String caseId, String deploymentId)
-
internalTriggerAdHocFragment
protected void internalTriggerAdHocFragment(ProcessInstanceDesc pi, String fragmentName, Object data) throws CaseNotFoundException
- Throws:
CaseNotFoundException
-
verifyCaseIdExists
protected ProcessInstanceDesc verifyCaseIdExists(String caseId) throws CaseNotFoundException
- Throws:
CaseNotFoundException
-
verifyCaseIdExisted
protected ProcessInstanceDesc verifyCaseIdExisted(String caseId) throws CaseNotFoundException
- Throws:
CaseNotFoundException
-
getCaseEventSupport
protected CaseEventSupport getCaseEventSupport(String deploymentId)
-
isEmpty
protected boolean isEmpty(Collection<?> data)
-
-