Search in sources :

Example 11 with TaskImpl

use of org.activiti.api.task.model.impl.TaskImpl in project Activiti by Activiti.

the class TaskAdminRuntimeImpl method complete.

@Override
public Task complete(CompleteTaskPayload completeTaskPayload) {
    Task task = task(completeTaskPayload.getTaskId());
    if (task == null) {
        throw new IllegalStateException("Task with id: " + completeTaskPayload.getTaskId() + " cannot be completed because it cannot be found.");
    }
    taskRuntimeHelper.handleCompleteTaskPayload(completeTaskPayload);
    TaskImpl competedTaskData = new TaskImpl(task.getId(), task.getName(), Task.TaskStatus.COMPLETED);
    taskService.complete(completeTaskPayload.getTaskId(), completeTaskPayload.getVariables(), true);
    return competedTaskData;
}
Also used : Task(org.activiti.api.task.model.Task) TaskImpl(org.activiti.api.task.model.impl.TaskImpl)

Aggregations

TaskImpl (org.activiti.api.task.model.impl.TaskImpl)11 Task (org.activiti.api.task.model.Task)7 Test (org.junit.jupiter.api.Test)5 List (java.util.List)2 TaskPayloadBuilder (org.activiti.api.task.model.builders.TaskPayloadBuilder)2 UpdateTaskPayload (org.activiti.api.task.model.payloads.UpdateTaskPayload)2 TaskAdminRuntime (org.activiti.api.task.runtime.TaskAdminRuntime)2 TaskRuntime (org.activiti.api.task.runtime.TaskRuntime)2 Task (org.activiti.engine.task.Task)2 RuntimeTestConfiguration (org.activiti.spring.boot.RuntimeTestConfiguration)2 SecurityUtil (org.activiti.spring.boot.security.util.SecurityUtil)2 TaskCleanUpUtil (org.activiti.spring.boot.test.util.TaskCleanUpUtil)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 AfterEach (org.junit.jupiter.api.AfterEach)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 TaskCancelledEvent (org.activiti.api.task.runtime.events.TaskCancelledEvent)1 ActivitiEntityEventImpl (org.activiti.engine.delegate.event.impl.ActivitiEntityEventImpl)1 TaskQuery (org.activiti.engine.task.TaskQuery)1