use of org.kie.server.api.model.taskassigning.TaskData in project droolsjbpm-integration by kiegroup.
the class SolutionSynchronizer method recoverSolution.
private TaskAssigningSolution recoverSolution() {
final TaskAssigningRuntimeDelegate.FindTasksResult result = delegate.findTasks(Arrays.asList(Ready, Reserved, InProgress, Suspended), null, TaskInputVariablesReadMode.READ_FOR_ALL);
final LocalDateTime nextQueryTime = context.shiftQueryTime(trimMillis(result.getQueryTime()));
final LocalDateTime adjustedFirstQueryTime = context.shiftQueryTime(nextQueryTime);
context.setPreviousQueryTime(adjustedFirstQueryTime);
context.setNextQueryTime(nextQueryTime);
context.clearTaskChangeTimes();
final List<TaskData> taskDataList = result.getTasks();
LOGGER.debug("{} tasks where loaded for solution recovery, with result.queryTime: {}", taskDataList.size(), result.getQueryTime());
final List<User> externalUsers = userSystemService.findAllUsers();
return buildSolution(taskDataList, externalUsers);
}
use of org.kie.server.api.model.taskassigning.TaskData in project droolsjbpm-integration by kiegroup.
the class SolutionBuilderTest method buildAndCheckReservedTaskWithUnChangedPlanningTaskPublishedWasProcessedCorrect.
@Test
public void buildAndCheckReservedTaskWithUnChangedPlanningTaskPublishedWasProcessedCorrect() {
PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(true).index(1).build();
TaskData taskData = mockTaskData(1L, Reserved, planningTask.getAssignedUser());
buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, planningTask.getAssignedUser(), true);
}
use of org.kie.server.api.model.taskassigning.TaskData in project droolsjbpm-integration by kiegroup.
the class SolutionBuilderTest method mockTaskData.
private TaskData mockTaskData(Long taskId, Status status, String actualOwner) {
TaskData taskData = new TaskData();
taskData.setTaskId(taskId);
taskData.setActualOwner(actualOwner);
taskData.setStatus(convertToString(status));
taskData.setPriority(0);
taskData.setProcessInstanceId(1L);
taskData.setLastModificationDate(LocalDateTime.now());
return taskData;
}
use of org.kie.server.api.model.taskassigning.TaskData in project droolsjbpm-integration by kiegroup.
the class SolutionBuilderTest method buildAndCheckReservedForPlanningUserTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect.
@Test
public void buildAndCheckReservedForPlanningUserTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect() {
PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(true).index(1).build();
TaskData taskData = mockTaskData(1L, Reserved, PLANNING_USER_ID);
buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, taskData.getActualOwner(), false);
}
use of org.kie.server.api.model.taskassigning.TaskData in project droolsjbpm-integration by kiegroup.
the class SolutionBuilderTest method buildAndCheckInProgressTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect.
@Test
public void buildAndCheckInProgressTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect() {
PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(true).index(1).build();
TaskData taskData = mockTaskData(1L, InProgress, USER2);
buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, taskData.getActualOwner(), true);
}
Aggregations