public class UserTaskAdminServiceImpl extends Object implements UserTaskAdminService
Modifier and Type | Field and Description |
---|---|
static int |
ADMIN |
static int |
EXCL_OWNER |
static int |
POT_OWNER |
Constructor and Description |
---|
UserTaskAdminServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeError(String... errorId)
Acknowledge given error that it was reviewed and understood
|
void |
addBusinessAdmins(long taskId,
boolean removeExisting,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Adds new business admin for a given task.
|
void |
addExcludedOwners(long taskId,
boolean removeExisting,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Adds new excluded owners for a given task.
|
protected void |
addPeopleAssignment(long taskId,
boolean removeExisting,
int type,
org.kie.api.task.model.OrganizationalEntity... orgEntities) |
void |
addPotentialOwners(long taskId,
boolean removeExisting,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Adds new potential owners for a given task.
|
void |
addTaskInput(long taskId,
String name,
Object value)
Adds new item to task input variables.
|
void |
addTaskInputs(long taskId,
Map<String,Object> data)
Adds new items to task input variables.
|
protected void |
applyQueryContext(Map<String,Object> params,
org.kie.api.runtime.query.QueryContext queryContext) |
org.kie.internal.task.api.model.EmailNotification |
buildEmailNotification(String subjectStr,
List<org.kie.api.task.model.OrganizationalEntity> recipients,
String bodyStr,
String fromStr,
String replyToStr)
Builds email notification based on given parameters that can be used as argument for notifyWhenNotStarted and notifyWhenNotCompleted methods
|
void |
cancelNotification(long taskId,
long notificationId)
Cancels given notification on a task
|
void |
cancelReassignment(long taskId,
long reassignmentId)
Cancels given reassignment on a task
|
protected List<Short> |
getAckMode(boolean includeAcknowledged) |
org.kie.internal.runtime.error.ExecutionError |
getError(String errorId)
Returns execution error identified by given error id
|
List<org.kie.internal.runtime.error.ExecutionError> |
getErrors(boolean includeAcknowledged,
org.kie.api.runtime.query.QueryContext queryContext)
Returns execution errors that are classified as task type errors
|
List<org.kie.internal.runtime.error.ExecutionError> |
getErrorsByTaskId(long taskId,
boolean includeAcknowledged,
org.kie.api.runtime.query.QueryContext queryContext)
Returns execution errors for given task id
|
List<org.kie.internal.runtime.error.ExecutionError> |
getErrorsByTaskName(String taskName,
boolean includeAcknowledged,
org.kie.api.runtime.query.QueryContext queryContext)
Returns execution errors for given task name
|
List<org.kie.internal.runtime.error.ExecutionError> |
getErrorsByTaskName(String processId,
String taskName,
boolean includeAcknowledged,
org.kie.api.runtime.query.QueryContext queryContext)
Returns execution errors for given task name and process id
|
List<org.kie.internal.runtime.error.ExecutionError> |
getErrorsByTaskName(String deploymentId,
String processId,
String taskName,
boolean includeAcknowledged,
org.kie.api.runtime.query.QueryContext queryContext)
Returns execution errors for given task name, process id and deployment id
|
Collection<TaskNotification> |
getTaskNotifications(long taskId,
boolean activeOnly)
Returns task notifications scheduled for given task
|
Collection<TaskReassignment> |
getTaskReassignments(long taskId,
boolean activeOnly)
Returns task reassignments scheduled for given task
|
protected Long |
notify(long taskId,
String timeExpression,
org.kie.internal.task.api.TaskDeadlinesService.DeadlineType type,
org.kie.internal.task.api.model.Notification notification) |
Long |
notifyWhenNotCompleted(long taskId,
String timeExpression,
org.kie.internal.task.api.model.Notification notification)
Sends notification (of notification type) to given recipients in case task was not completed
before time given as timeExpression elapses.
|
Long |
notifyWhenNotStarted(long taskId,
String timeExpression,
org.kie.internal.task.api.model.Notification notification)
Sends notification (of notification type) to given recipients in case task was not started
before time given as timeExpression elapses.
|
protected Long |
reassign(long taskId,
String timeExpression,
org.kie.internal.task.api.TaskDeadlinesService.DeadlineType type,
org.kie.api.task.model.OrganizationalEntity... orgEntities) |
Long |
reassignWhenNotCompleted(long taskId,
String timeExpression,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Reassign automatically a task in case it was not completed before time given as timeExpression elapses.
|
Long |
reassignWhenNotStarted(long taskId,
String timeExpression,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Reassign automatically a task in case it was not started before time given as timeExpression elapses.
|
void |
removeBusinessAdmins(long taskId,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Remove existing business admin from given task.
|
void |
removeExcludedOwners(long taskId,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Remove existing excluded owners from given task.
|
protected void |
removePeopleAssignment(long taskId,
int type,
org.kie.api.task.model.OrganizationalEntity... orgEntities) |
void |
removePotentialOwners(long taskId,
org.kie.api.task.model.OrganizationalEntity... orgEntities)
Remove existing potential owners from given task.
|
void |
removeTaskInputs(long taskId,
String... name)
Removes one or more input variables from a task.
|
void |
removeTaskOutputs(long taskId,
String... name)
Removes one or more output variables from a task.
|
void |
setCommandService(TransactionalCommandService commandService) |
void |
setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider) |
void |
setRuntimeDataService(RuntimeDataService runtimeDataService) |
void |
setUserTaskService(UserTaskService userTaskService) |
public static final int POT_OWNER
public static final int EXCL_OWNER
public static final int ADMIN
public void setUserTaskService(UserTaskService userTaskService)
public void setRuntimeDataService(RuntimeDataService runtimeDataService)
public void setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)
public void setCommandService(TransactionalCommandService commandService)
public void addPotentialOwners(long taskId, boolean removeExisting, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
addPotentialOwners
in interface UserTaskAdminService
taskId
- unique task idremoveExisting
- specifies if existing potential owners should be removedorgEntities
- one or more potential owner to be added to a taskTaskNotFoundException
- thrown when there is no task with given idpublic void addExcludedOwners(long taskId, boolean removeExisting, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
addExcludedOwners
in interface UserTaskAdminService
taskId
- unique task idremoveExisting
- specifies if existing excluded owners should be removedorgEntities
- one or more excluded owner to be added to a taskTaskNotFoundException
- thrown when there is no task with given idpublic void addBusinessAdmins(long taskId, boolean removeExisting, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
addBusinessAdmins
in interface UserTaskAdminService
taskId
- unique task idremoveExisting
- specifies if existing business admins should be removedorgEntities
- one or more business admin to be added to a taskTaskNotFoundException
- thrown when there is no task with given idpublic void removePotentialOwners(long taskId, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
removePotentialOwners
in interface UserTaskAdminService
taskId
- unique task idorgEntities
- one or more potential owner to be removed from a taskTaskNotFoundException
- thrown when there is no task with given idpublic void removeExcludedOwners(long taskId, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
removeExcludedOwners
in interface UserTaskAdminService
taskId
- unique task idorgEntities
- one or more excluded owner to be removed from a taskTaskNotFoundException
- thrown when there is no task with given idpublic void removeBusinessAdmins(long taskId, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException, IllegalStateException
UserTaskAdminService
removeBusinessAdmins
in interface UserTaskAdminService
taskId
- unique task idorgEntities
- one or more business admin to be removed from a taskTaskNotFoundException
- thrown when there is no task with given idIllegalStateException
- in case there are no business admins left on a task - there must be at least one business adminpublic void addTaskInput(long taskId, String name, Object value) throws TaskNotFoundException
UserTaskAdminService
addTaskInput
in interface UserTaskAdminService
taskId
- unique task idname
- name of the input variable to be addedvalue
- value of the input variableTaskNotFoundException
- thrown when there is no task with given idpublic void addTaskInputs(long taskId, Map<String,Object> data) throws TaskNotFoundException
UserTaskAdminService
addTaskInputs
in interface UserTaskAdminService
taskId
- unique task iddata
- map of key (name of the variable) and value (value of the variable)TaskNotFoundException
- thrown when there is no task with given idpublic void removeTaskInputs(long taskId, String... name) throws TaskNotFoundException
UserTaskAdminService
removeTaskInputs
in interface UserTaskAdminService
taskId
- unique task idname
- name(s) of the input variables to be removedTaskNotFoundException
- thrown when there is no task with given idpublic void removeTaskOutputs(long taskId, String... name) throws TaskNotFoundException
UserTaskAdminService
removeTaskOutputs
in interface UserTaskAdminService
taskId
- unique task idname
- name(s) of the output variables to be removedTaskNotFoundException
- thrown when there is no task with given idpublic Long reassignWhenNotStarted(long taskId, String timeExpression, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
reassignWhenNotStarted
in interface UserTaskAdminService
taskId
- unique task idtimeExpression
- time expression in duration format as 2s, 5h, 7dorgEntities
- users/groups that will be reassigned to after conditions are metTaskNotFoundException
- thrown when there is no task with given idpublic Long reassignWhenNotCompleted(long taskId, String timeExpression, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
UserTaskAdminService
reassignWhenNotCompleted
in interface UserTaskAdminService
taskId
- unique task idtimeExpression
- time expression in duration format as 2s, 5h, 7dorgEntities
- users/groups that will be reassigned to after conditions are metTaskNotFoundException
- thrown when there is no task with given idpublic Long notifyWhenNotStarted(long taskId, String timeExpression, org.kie.internal.task.api.model.Notification notification) throws TaskNotFoundException
UserTaskAdminService
notifyWhenNotStarted
in interface UserTaskAdminService
taskId
- unique task idtimeExpression
- time expression in duration format as 2s, 5h, 7dnotification
- actual notification to be sentTaskNotFoundException
- thrown when there is no task with given idpublic Long notifyWhenNotCompleted(long taskId, String timeExpression, org.kie.internal.task.api.model.Notification notification) throws TaskNotFoundException
UserTaskAdminService
notifyWhenNotCompleted
in interface UserTaskAdminService
taskId
- unique task idtimeExpression
- time expression in duration format as 2s, 5h, 7dnotification
- actual notification to be sentTaskNotFoundException
- thrown when there is no task with given idpublic Collection<TaskReassignment> getTaskReassignments(long taskId, boolean activeOnly) throws TaskNotFoundException
UserTaskAdminService
getTaskReassignments
in interface UserTaskAdminService
taskId
- unique task idactiveOnly
- determines if only active (not yet fired) should be returnedTaskNotFoundException
- thrown when there is no task with given idpublic Collection<TaskNotification> getTaskNotifications(long taskId, boolean activeOnly) throws TaskNotFoundException
UserTaskAdminService
getTaskNotifications
in interface UserTaskAdminService
taskId
- unique task idactiveOnly
- determines if only active (not yet fired) should be returnedTaskNotFoundException
- thrown when there is no task with given idpublic void cancelNotification(long taskId, long notificationId) throws TaskNotFoundException
UserTaskAdminService
cancelNotification
in interface UserTaskAdminService
taskId
- unique task idnotificationId
- unique notification idTaskNotFoundException
- thrown when there is no task with given idpublic void cancelReassignment(long taskId, long reassignmentId) throws TaskNotFoundException
UserTaskAdminService
cancelReassignment
in interface UserTaskAdminService
taskId
- unique task idreassignmentId
- unique reassignment idTaskNotFoundException
- thrown when there is no task with given idpublic org.kie.internal.task.api.model.EmailNotification buildEmailNotification(String subjectStr, List<org.kie.api.task.model.OrganizationalEntity> recipients, String bodyStr, String fromStr, String replyToStr)
UserTaskAdminService
buildEmailNotification
in interface UserTaskAdminService
subjectStr
- email subjectrecipients
- list of recipients to be included in the notification, must be at least onebodyStr
- email body, can reference task variablesfromStr
- user who sends the emailreplyToStr
- optional reply to addresspublic List<org.kie.internal.runtime.error.ExecutionError> getErrors(boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
UserTaskAdminService
getErrors
in interface UserTaskAdminService
includeAcknowledged
- indicates whether to include acknowledged errors or notqueryContext
- control parameters for paginationpublic List<org.kie.internal.runtime.error.ExecutionError> getErrorsByTaskId(long taskId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
UserTaskAdminService
getErrorsByTaskId
in interface UserTaskAdminService
taskId
- unique task idincludeAcknowledged
- indicates whether to include acknowledged errors or notqueryContext
- control parameters for paginationpublic List<org.kie.internal.runtime.error.ExecutionError> getErrorsByTaskName(String taskName, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
UserTaskAdminService
getErrorsByTaskName
in interface UserTaskAdminService
taskName
- name of the taskincludeAcknowledged
- indicates whether to include acknowledged errors or notqueryContext
- control parameters for paginationpublic List<org.kie.internal.runtime.error.ExecutionError> getErrorsByTaskName(String processId, String taskName, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
UserTaskAdminService
getErrorsByTaskName
in interface UserTaskAdminService
processId
- process id of the process that task belongs totaskName
- name of the taskincludeAcknowledged
- indicates whether to include acknowledged errors or notqueryContext
- control parameters for paginationpublic List<org.kie.internal.runtime.error.ExecutionError> getErrorsByTaskName(String deploymentId, String processId, String taskName, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
UserTaskAdminService
getErrorsByTaskName
in interface UserTaskAdminService
deploymentId
- deployment id that contains given processprocessId
- process id of the process that task belongs totaskName
- name of the taskincludeAcknowledged
- indicates whether to include acknowledged errors or notqueryContext
- control parameters for paginationpublic void acknowledgeError(String... errorId) throws ExecutionErrorNotFoundException
UserTaskAdminService
acknowledgeError
in interface UserTaskAdminService
errorId
- unique id of the errorExecutionErrorNotFoundException
- thrown when there is no unacknowledged error with that idpublic org.kie.internal.runtime.error.ExecutionError getError(String errorId) throws ExecutionErrorNotFoundException
UserTaskAdminService
getError
in interface UserTaskAdminService
errorId
- unique id of the errorExecutionErrorNotFoundException
- is thrown in case no error was found for given error idprotected void addPeopleAssignment(long taskId, boolean removeExisting, int type, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
TaskNotFoundException
protected void removePeopleAssignment(long taskId, int type, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
TaskNotFoundException
protected Long reassign(long taskId, String timeExpression, org.kie.internal.task.api.TaskDeadlinesService.DeadlineType type, org.kie.api.task.model.OrganizationalEntity... orgEntities) throws TaskNotFoundException
TaskNotFoundException
protected Long notify(long taskId, String timeExpression, org.kie.internal.task.api.TaskDeadlinesService.DeadlineType type, org.kie.internal.task.api.model.Notification notification) throws TaskNotFoundException
TaskNotFoundException
protected void applyQueryContext(Map<String,Object> params, org.kie.api.runtime.query.QueryContext queryContext)
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.