use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskAdminServiceImpl method cancelNotification.
@Override
public void cancelNotification(String deploymentId, long taskId, long notificationId) throws TaskNotFoundException {
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
userTaskService.execute(task.getDeploymentId(), ProcessInstanceIdContext.get(task.getProcessInstanceId()), new CancelTaskDeadlineCommand(identityProvider.getName(), taskId, notificationId));
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskAdminServiceImpl method getTaskNotifications.
@Override
public Collection<TaskNotification> getTaskNotifications(String deploymentId, long taskId, boolean activeOnly) throws TaskNotFoundException {
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
return userTaskService.execute(task.getDeploymentId(), ProcessInstanceIdContext.get(task.getProcessInstanceId()), new ListTaskNotificationsCommand(identityProvider.getName(), taskId, activeOnly));
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskAdminServiceImpl method addPeopleAssignment.
/*
* Internal methods
*/
protected void addPeopleAssignment(String deploymentId, long taskId, boolean removeExisting, int type, OrganizationalEntity... orgEntities) throws TaskNotFoundException {
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
userTaskService.execute(task.getDeploymentId(), ProcessInstanceIdContext.get(task.getProcessInstanceId()), new AddPeopleAssignmentsCommand(identityProvider.getName(), taskId, type, orgEntities, removeExisting));
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskAdminServiceImpl method removeTaskInputs.
@Override
public void removeTaskInputs(String deploymentId, long taskId, String... name) throws TaskNotFoundException {
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
userTaskService.execute(task.getDeploymentId(), ProcessInstanceIdContext.get(task.getProcessInstanceId()), new RemoveTaskDataCommand(identityProvider.getName(), taskId, Arrays.asList(name), true));
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskAdminServiceImpl method notify.
protected Long notify(String deploymentId, long taskId, String timeExpression, DeadlineType type, Notification notification) throws TaskNotFoundException {
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
List<Escalation> escalations = new ArrayList<Escalation>();
Deadline taskDeadline = TaskModelProvider.getFactory().newDeadline();
taskDeadline.setEscalations(escalations);
Escalation escalation = TaskModelProvider.getFactory().newEscalation();
escalations.add(escalation);
escalation.setName("Admin notification for task " + taskId);
List<Notification> notifications = new ArrayList<Notification>();
notifications.add(notification);
escalation.setNotifications(notifications);
return userTaskService.execute(task.getDeploymentId(), ProcessInstanceIdContext.get(task.getProcessInstanceId()), new ScheduleTaskDeadlineCommand(identityProvider.getName(), taskId, type, taskDeadline, timeExpression));
}
Aggregations