use of org.camunda.bpm.engine.TaskService in project camunda-bpm-platform by camunda.
the class HalIdentityLinkResolver method resolveNotCachedLinks.
protected List<HalResource<?>> resolveNotCachedLinks(String[] linkedIds, ProcessEngine processEngine) {
TaskService taskService = processEngine.getTaskService();
List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(linkedIds[0]);
List<HalResource<?>> resolvedIdentityLinks = new ArrayList<HalResource<?>>();
for (IdentityLink identityLink : identityLinks) {
resolvedIdentityLinks.add(HalIdentityLink.fromIdentityLink(identityLink));
}
return resolvedIdentityLinks;
}
use of org.camunda.bpm.engine.TaskService in project camunda-bpm-platform by camunda.
the class TaskRestServiceImpl method createTask.
public void createTask(TaskDto taskDto) {
ProcessEngine engine = getProcessEngine();
TaskService taskService = engine.getTaskService();
Task newTask = taskService.newTask(taskDto.getId());
taskDto.updateTask(newTask);
try {
taskService.saveTask(newTask);
} catch (NotValidException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, "Could not save task: " + e.getMessage());
}
}
use of org.camunda.bpm.engine.TaskService in project camunda-bpm-platform by camunda.
the class TaskResourceImpl method resolve.
@Override
public void resolve(CompleteTaskDto dto) {
TaskService taskService = engine.getTaskService();
try {
VariableMap variables = VariableValueDto.toMap(dto.getVariables(), engine, objectMapper);
taskService.resolveTask(taskId, variables);
} catch (RestException e) {
String errorMessage = String.format("Cannot resolve task %s: %s", taskId, e.getMessage());
throw new InvalidRequestException(e.getStatus(), e, errorMessage);
}
}
use of org.camunda.bpm.engine.TaskService in project camunda-bpm-platform by camunda.
the class TaskResourceImpl method getIdentityLinks.
@Override
public List<IdentityLinkDto> getIdentityLinks(String type) {
TaskService taskService = engine.getTaskService();
List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
List<IdentityLinkDto> result = new ArrayList<IdentityLinkDto>();
for (IdentityLink link : identityLinks) {
if (type == null || type.equals(link.getType())) {
result.add(IdentityLinkDto.fromIdentityLink(link));
}
}
return result;
}
use of org.camunda.bpm.engine.TaskService in project camunda-bpm-platform by camunda.
the class TaskResourceImpl method claim.
@Override
public void claim(UserIdDto dto) {
TaskService taskService = engine.getTaskService();
taskService.claim(taskId, dto.getUserId());
}
Aggregations