use of org.kie.server.services.taskassigning.core.model.Task in project droolsjbpm-integration by kiegroup.
the class TraceHelper method traceSolution.
static void traceSolution(Logger logger, TaskAssigningSolution solution) {
logger.trace("{}*** Start of solution trace, with users = {} and tasks = {} ***", NEW_LINE, solution.getUserList().size(), solution.getTaskList().size());
for (User user : solution.getUserList()) {
Task nextTask = user.getNextTask();
while (nextTask != null) {
logger.trace("{} -> {}, pinned: {}, priority: {}, status: {}", user.getEntityId(), nextTask.getId(), nextTask.isPinned(), nextTask.getPriority(), nextTask.getStatus());
nextTask = nextTask.getNextTask();
}
}
logger.trace("*** End of solution trace ***");
}
use of org.kie.server.services.taskassigning.core.model.Task in project droolsjbpm-integration by kiegroup.
the class SolutionChangesBuilderTest method discardDuplicatedChanges.
@Test
public void discardDuplicatedChanges() {
TaskData taskData1 = mockTaskData(1, NAME, Ready, null);
TaskData taskData2 = mockTaskData(2, NAME, InProgress, null);
TaskData taskData3 = mockTaskData(3, NAME, Completed, null);
TaskData taskData4 = mockTaskData(4, NAME, Suspended, null);
Task task1 = mockTask(taskData1.getTaskId());
Task task2 = mockTask(taskData2.getTaskId());
Task task3 = mockTask(taskData3.getTaskId());
Task task4 = mockTask(taskData4.getTaskId());
List<TaskData> taskDataList = mockTaskDataList(taskData1, taskData2, taskData3, taskData4);
TaskAssigningSolution solution = mockSolution(Arrays.asList(task1, task2, task3, task4), Collections.emptyList());
taskDataList.forEach(taskData -> context.setTaskChangeTime(taskData.getTaskId(), taskData.getLastModificationDate()));
List<ProblemFactChange<TaskAssigningSolution>> result = SolutionChangesBuilder.create().withSolution(solution).withTasks(taskDataList).withUserSystem(userSystemService).withContext(context).build();
assertEquals(2, result.size());
assertChangeIsTheChangeSetId(result, 0);
assertChangeIsTheDummyTaskAssigned(result, ModelConstants.DUMMY_TASK_PLANNER_241, 1);
}
use of org.kie.server.services.taskassigning.core.model.Task in project droolsjbpm-integration by kiegroup.
the class SolverHandlerTest method onSolutionSynchronizedWithChanges.
@Test
public void onSolutionSynchronizedWithChanges() {
prepareStart();
List<ProblemFactChange<TaskAssigningSolution>> changes = new ArrayList<>();
changes.add(new TaskPropertyChangeProblemFactChange(new Task()));
SolutionSynchronizer.Result result = SolutionSynchronizer.Result.forChanges(changes);
doReturn(true).when(solverExecutor).isStarted();
synchronizerConsumerCaptor.getValue().accept(result);
verify(solverExecutor).addProblemFactChanges(changes);
verify(solutionProcessor, never()).process(any(TaskAssigningSolution.class));
verify(solutionSynchronizer, never()).synchronizeSolution(any(TaskAssigningSolution.class), any(LocalDateTime.class));
}
Aggregations