Search in sources :

Example 6 with PlanningTask

use of org.kie.server.api.model.taskassigning.PlanningTask in project droolsjbpm-integration by kiegroup.

the class SolutionBuilderTest method buildAndCheckReservedTaskWithModifiedPlanningTaskNotPublishedWasProcessedCorrect.

@Test
public void buildAndCheckReservedTaskWithModifiedPlanningTaskNotPublishedWasProcessedCorrect() {
    PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(false).index(1).build();
    TaskData taskData = mockTaskData(1L, Reserved, USER2);
    buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, taskData.getActualOwner(), true);
}
Also used : PlanningTask(org.kie.server.api.model.taskassigning.PlanningTask) TaskData(org.kie.server.api.model.taskassigning.TaskData) Test(org.junit.Test)

Example 7 with PlanningTask

use of org.kie.server.api.model.taskassigning.PlanningTask in project droolsjbpm-integration by kiegroup.

the class SolutionBuilderTest method buildAndCheckSuspendedTaskWithUnChangedPlanningTaskNotPublishedWasProcessedCorrect.

@Test
public void buildAndCheckSuspendedTaskWithUnChangedPlanningTaskNotPublishedWasProcessedCorrect() {
    PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(false).index(1).build();
    TaskData taskData = mockTaskData(1L, Suspended, planningTask.getAssignedUser());
    buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, planningTask.getAssignedUser(), true);
}
Also used : PlanningTask(org.kie.server.api.model.taskassigning.PlanningTask) TaskData(org.kie.server.api.model.taskassigning.TaskData) Test(org.junit.Test)

Example 8 with PlanningTask

use of org.kie.server.api.model.taskassigning.PlanningTask in project droolsjbpm-integration by kiegroup.

the class SolutionBuilderTest method buildAndCheckSuspendedTaskWithUnChangedPlanningTaskPublishedWasProcessedCorrect.

@Test
public void buildAndCheckSuspendedTaskWithUnChangedPlanningTaskPublishedWasProcessedCorrect() {
    PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(true).index(1).build();
    TaskData taskData = mockTaskData(1L, Suspended, planningTask.getAssignedUser());
    buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, planningTask.getAssignedUser(), true);
}
Also used : PlanningTask(org.kie.server.api.model.taskassigning.PlanningTask) TaskData(org.kie.server.api.model.taskassigning.TaskData) Test(org.junit.Test)

Example 9 with PlanningTask

use of org.kie.server.api.model.taskassigning.PlanningTask in project droolsjbpm-integration by kiegroup.

the class SolutionBuilderTest method buildAndCheckReservedTaskWithUnChangedPlanningTaskNotPublishedWasProcessedCorrect.

@Test
public void buildAndCheckReservedTaskWithUnChangedPlanningTaskNotPublishedWasProcessedCorrect() {
    PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(false).index(1).build();
    TaskData taskData = mockTaskData(1L, Reserved, planningTask.getAssignedUser());
    buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, planningTask.getAssignedUser(), false);
}
Also used : PlanningTask(org.kie.server.api.model.taskassigning.PlanningTask) TaskData(org.kie.server.api.model.taskassigning.TaskData) Test(org.junit.Test)

Example 10 with PlanningTask

use of org.kie.server.api.model.taskassigning.PlanningTask in project droolsjbpm-integration by kiegroup.

the class SolutionBuilderTest method buildAndCheckSuspendedTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect.

@Test
public void buildAndCheckSuspendedTaskWithModifiedPlanningTaskPublishedWasProcessedCorrect() {
    PlanningTask planningTask = PlanningTask.builder().taskId(1L).assignedUser(USER1).published(true).index(1).build();
    TaskData taskData = mockTaskData(1L, Suspended, USER2);
    buildAndCheckTaskWithPlanningTaskWasProcessedCorrect(taskData, planningTask, taskData.getActualOwner(), true);
}
Also used : PlanningTask(org.kie.server.api.model.taskassigning.PlanningTask) TaskData(org.kie.server.api.model.taskassigning.TaskData) Test(org.junit.Test)

Aggregations

PlanningTask (org.kie.server.api.model.taskassigning.PlanningTask)23 TaskData (org.kie.server.api.model.taskassigning.TaskData)20 Test (org.junit.Test)17 ArrayList (java.util.ArrayList)5 PlanningItem (org.kie.server.api.model.taskassigning.PlanningItem)4 Task (org.kie.server.services.taskassigning.core.model.Task)4 List (java.util.List)3 PlanningExecutionResult (org.kie.server.api.model.taskassigning.PlanningExecutionResult)3 PlanningItemList (org.kie.server.api.model.taskassigning.PlanningItemList)3 TaskAssigningSolution (org.kie.server.services.taskassigning.core.model.TaskAssigningSolution)3 User (org.kie.server.services.taskassigning.core.model.User)3 HashMap (java.util.HashMap)2 Status (org.kie.api.task.model.Status)2 StatusConverter.convertFromString (org.kie.server.api.model.taskassigning.util.StatusConverter.convertFromString)2 Arrays (java.util.Arrays)1 Map (java.util.Map)1 Function (java.util.function.Function)1 Collectors (java.util.stream.Collectors)1 StringUtils.isNotEmpty (org.apache.commons.lang3.StringUtils.isNotEmpty)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1