TSK-742 Handle attachments on classification update
This commit is contained in:
parent
775c50b543
commit
5c66f14d54
|
@ -4,6 +4,8 @@ import java.sql.SQLException;
|
|||
import java.sql.SQLIntegrityConstraintViolationException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -261,14 +263,7 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
|
||||
if (classification.getServiceLevel() != null && !"".equals(classification.getServiceLevel())) {
|
||||
try {
|
||||
Duration.parse(classification.getServiceLevel());
|
||||
} catch (Exception e) {
|
||||
throw new InvalidArgumentException("Invalid service level. Please use the format defined by ISO 8601. "
|
||||
+ "For example: \"P2D\" represents a period of \"two days.\" "
|
||||
+ "Or \"P2DT6H\" represents a period of \"two days and six hours.\"",
|
||||
e.getCause());
|
||||
}
|
||||
validateServiceLevel(classification.getServiceLevel());
|
||||
}
|
||||
|
||||
if (classification.getKey() == null) {
|
||||
|
@ -300,6 +295,50 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
}
|
||||
|
||||
private void validateServiceLevel(String serviceLevel) throws InvalidArgumentException {
|
||||
Duration duration;
|
||||
try {
|
||||
duration = Duration.parse(serviceLevel);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new InvalidArgumentException("Invalid service level " + serviceLevel
|
||||
+ ". The formats accepted are based on the ISO-8601 duration format PnDTnHnMn.nS with days considered to be exactly 24 hours. "
|
||||
+ "For example: \"P2D\" represents a period of \"two days.\" ",
|
||||
e.getCause());
|
||||
}
|
||||
// check that the duration contains only whole days and no remaining hours, minutes or seconds
|
||||
LocalDateTime ref = LocalDateTime.now(); // reference timestamp
|
||||
LocalDateTime end = ref.plus(duration);
|
||||
// find the years part
|
||||
LocalDateTime ldt = ref;
|
||||
long years = ChronoUnit.YEARS.between(ldt, end);
|
||||
|
||||
// find the months part
|
||||
ldt = ldt.plus(years, ChronoUnit.YEARS);
|
||||
long months = ChronoUnit.MONTHS.between(ldt, end);
|
||||
|
||||
// find the days part
|
||||
ldt = ldt.plus(months, ChronoUnit.MONTHS);
|
||||
long days = ChronoUnit.DAYS.between(ldt, end);
|
||||
|
||||
// find the hours part
|
||||
ldt = ldt.plus(days, ChronoUnit.DAYS);
|
||||
long hours = ChronoUnit.HOURS.between(ldt, end);
|
||||
|
||||
// find the minutes part
|
||||
ldt = ldt.plus(hours, ChronoUnit.HOURS);
|
||||
long minutes = ChronoUnit.MINUTES.between(ldt, end);
|
||||
|
||||
// find the seconds part
|
||||
ldt = ldt.plus(minutes, ChronoUnit.MINUTES);
|
||||
long seconds = ChronoUnit.SECONDS.between(ldt, end);
|
||||
|
||||
if (hours != 0 || minutes != 0 || seconds != 0) {
|
||||
throw new InvalidArgumentException("Invalid service level " + serviceLevel + ". Taskana only supports service levels that"
|
||||
+ " contain a number of whole days without additional hours, minutes or seconds.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Classification getClassification(String id) throws ClassificationNotFoundException {
|
||||
if (id == null) {
|
||||
|
|
|
@ -1424,6 +1424,31 @@ public class TaskServiceImpl implements TaskService {
|
|||
}
|
||||
}
|
||||
|
||||
public Set<String> findTasksIdsAffectedByClassificationChange(String classificationId) {
|
||||
// tasks directly affected
|
||||
List<TaskSummary> tasks = createTaskQuery()
|
||||
.classificationIdIn(classificationId)
|
||||
.stateIn(TaskState.READY, TaskState.CLAIMED)
|
||||
.list();
|
||||
|
||||
// tasks indirectly affected via attachments
|
||||
List<String> taskIdsFromAttachments = attachmentMapper.findTaskIdsAffectedByClassificationChange(classificationId);
|
||||
|
||||
List<String> filteredTaskIdsFromAttachments = taskIdsFromAttachments.isEmpty() ? new ArrayList<>()
|
||||
: taskMapper.filterTaskIdsForNotCompleted(taskIdsFromAttachments);
|
||||
|
||||
Set<String> affectedTaskIds = new HashSet<>(filteredTaskIdsFromAttachments);
|
||||
for (TaskSummary task : tasks) {
|
||||
affectedTaskIds.add(task.getTaskId());
|
||||
}
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("the following tasks are affected by the update of classification {} : {}", classificationId,
|
||||
LoggerUtils.setToString(affectedTaskIds));
|
||||
}
|
||||
return affectedTaskIds;
|
||||
}
|
||||
|
||||
|
||||
public void refreshPriorityAndDueDate(String taskId)
|
||||
throws ClassificationNotFoundException {
|
||||
LOGGER.debug("entry to refreshPriorityAndDueDate(taskId = {})", taskId);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package pro.taskana.jobs;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -9,11 +8,10 @@ import java.util.Set;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import pro.taskana.TaskState;
|
||||
import pro.taskana.TaskSummary;
|
||||
|
||||
import pro.taskana.TaskanaEngine;
|
||||
import pro.taskana.exceptions.TaskanaException;
|
||||
import pro.taskana.impl.util.LoggerUtils;
|
||||
import pro.taskana.impl.TaskServiceImpl;
|
||||
import pro.taskana.transaction.TaskanaTransactionProvider;
|
||||
|
||||
/**
|
||||
|
@ -48,7 +46,8 @@ public class ClassificationChangedJob extends AbstractTaskanaJob {
|
|||
public void run() throws TaskanaException {
|
||||
LOGGER.info("Running ClassificationChangedJob for classification ({})", classificationId);
|
||||
try {
|
||||
Set<String> affectedTaskIds = findTasksIdsAffectedByClassificationChange();
|
||||
TaskServiceImpl taskService = (TaskServiceImpl) taskanaEngineImpl.getTaskService();
|
||||
Set<String> affectedTaskIds = taskService.findTasksIdsAffectedByClassificationChange(classificationId);
|
||||
scheduleTaskRefreshJobs(affectedTaskIds);
|
||||
LOGGER.info("ClassificationChangedJob ended successfully.");
|
||||
} catch (Exception e) {
|
||||
|
@ -56,31 +55,6 @@ public class ClassificationChangedJob extends AbstractTaskanaJob {
|
|||
}
|
||||
}
|
||||
|
||||
private Set<String> findTasksIdsAffectedByClassificationChange() {
|
||||
List<TaskSummary> tasks = taskanaEngineImpl.getTaskService()
|
||||
.createTaskQuery()
|
||||
.classificationIdIn(classificationId)
|
||||
.stateIn(TaskState.READY, TaskState.CLAIMED)
|
||||
.list();
|
||||
// TODO - implement once the attachment filter is available
|
||||
// List<String> taskIdsFromAttachments = attachmentMapper
|
||||
// .findTaskIdsAffectedByClassificationChange(classificationId);
|
||||
|
||||
// List<String> filteredTaskIdsFromAttachments = taskIdsFromAttachments.isEmpty() ? new ArrayList<>()
|
||||
// : taskMapper.filterTaskIdsForNotCompleted(taskIdsFromAttachments);
|
||||
|
||||
// Set<String> affectedTaskIds = new HashSet<>(filteredTaskIdsFromAttachments);
|
||||
Set<String> affectedTaskIds = new HashSet<>();
|
||||
for (TaskSummary task : tasks) {
|
||||
affectedTaskIds.add(task.getTaskId());
|
||||
}
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("the following tasks are affected by the update of classification {} : {}", classificationId,
|
||||
LoggerUtils.setToString(affectedTaskIds));
|
||||
}
|
||||
return affectedTaskIds;
|
||||
}
|
||||
|
||||
private void scheduleTaskRefreshJobs(Set<String> affectedTaskIds) {
|
||||
int batchSize = taskanaEngineImpl.getConfiguration().getMaxNumberOfUpdatesPerTransaction();
|
||||
List<List<String>> affectedTaskBatches = partition(affectedTaskIds, batchSize);
|
||||
|
|
|
@ -523,7 +523,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
|
|||
List<ClassificationSummary> results = classificationService.createClassificationQuery()
|
||||
.orderByServiceLevel(desc)
|
||||
.list();
|
||||
assertEquals("PT7H", results.get(0).getServiceLevel());
|
||||
assertEquals("PT24H", results.get(0).getServiceLevel());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -74,7 +74,7 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
classification.setParentId("CLI:100000000000000000000000000000000004");
|
||||
classification.setParentKey("L11010");
|
||||
classification.setPriority(1000);
|
||||
classification.setServiceLevel("P2DT3H4M");
|
||||
classification.setServiceLevel("P2DT24H");
|
||||
|
||||
classificationService.updateClassification(classification);
|
||||
|
||||
|
@ -214,10 +214,12 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
classification.setServiceLevel("P15D");
|
||||
|
||||
classificationService.updateClassification(classification);
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(10);
|
||||
JobRunner runner = new JobRunner(taskanaEngine);
|
||||
// need to run jobs twice, since the first job creates a second one.
|
||||
runner.runJobs();
|
||||
Thread.sleep(10); // otherwise the next runJobs call intermittently doesn't find the Job created
|
||||
// by the previous step (it searches with DueDate < CurrentTime)
|
||||
runner.runJobs();
|
||||
// Get and check the new value
|
||||
Classification updatedClassification = classificationService
|
||||
|
@ -225,58 +227,66 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
assertNotNull(updatedClassification);
|
||||
|
||||
assertTrue(!modifiedBefore.isAfter(updatedClassification.getModified()));
|
||||
List<String> affectedTasks = new ArrayList<>(
|
||||
Arrays.asList("TKI:000000000000000000000000000000000003", "TKI:000000000000000000000000000000000004"));
|
||||
// TODO - resume old behaviour after attachment query is possible.
|
||||
// List<String> affectedTasks = new ArrayList<>(
|
||||
// Arrays.asList("TKI:000000000000000000000000000000000000", "TKI:000000000000000000000000000000000003",
|
||||
// "TKI:000000000000000000000000000000000004", "TKI:000000000000000000000000000000000005",
|
||||
// "TKI:000000000000000000000000000000000006", "TKI:000000000000000000000000000000000007",
|
||||
// "TKI:000000000000000000000000000000000008", "TKI:000000000000000000000000000000000009",
|
||||
// "TKI:000000000000000000000000000000000010", "TKI:000000000000000000000000000000000011",
|
||||
// "TKI:000000000000000000000000000000000012", "TKI:000000000000000000000000000000000013",
|
||||
// "TKI:000000000000000000000000000000000014", "TKI:000000000000000000000000000000000015",
|
||||
// "TKI:000000000000000000000000000000000016", "TKI:000000000000000000000000000000000017",
|
||||
// "TKI:000000000000000000000000000000000018", "TKI:000000000000000000000000000000000019",
|
||||
// "TKI:000000000000000000000000000000000020", "TKI:000000000000000000000000000000000021",
|
||||
// "TKI:000000000000000000000000000000000022", "TKI:000000000000000000000000000000000023",
|
||||
// "TKI:000000000000000000000000000000000024", "TKI:000000000000000000000000000000000025",
|
||||
// "TKI:000000000000000000000000000000000026", "TKI:000000000000000000000000000000000027",
|
||||
// "TKI:000000000000000000000000000000000028", "TKI:000000000000000000000000000000000029",
|
||||
// "TKI:000000000000000000000000000000000030", "TKI:000000000000000000000000000000000031",
|
||||
// "TKI:000000000000000000000000000000000032", "TKI:000000000000000000000000000000000033",
|
||||
// "TKI:000000000000000000000000000000000034", "TKI:000000000000000000000000000000000035",
|
||||
// "TKI:000000000000000000000000000000000053", "TKI:000000000000000000000000000000000054",
|
||||
// "TKI:000000000000000000000000000000000055", "TKI:000000000000000000000000000000000100",
|
||||
// "TKI:000000000000000000000000000000000101", "TKI:000000000000000000000000000000000102",
|
||||
// "TKI:000000000000000000000000000000000103"));
|
||||
// List<String> indirectlyAffectedTasks = new ArrayList<>(Arrays.asList(
|
||||
// "TKI:000000000000000000000000000000000000", "TKI:000000000000000000000000000000000053",
|
||||
// "TKI:000000000000000000000000000000000054", "TKI:000000000000000000000000000000000055"));
|
||||
|
||||
TaskService taskService = taskanaEngine.getTaskService();
|
||||
|
||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter
|
||||
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
|
||||
|
||||
for (String taskId : affectedTasks) {
|
||||
List<String> tasksWithP1D = new ArrayList<>(Arrays.asList(
|
||||
"TKI:000000000000000000000000000000000054",
|
||||
"TKI:000000000000000000000000000000000055",
|
||||
"TKI:000000000000000000000000000000000000",
|
||||
"TKI:000000000000000000000000000000000011",
|
||||
"TKI:000000000000000000000000000000000053"
|
||||
));
|
||||
validateNewTaskProperties(before, tasksWithP1D, taskService, converter, 1);
|
||||
|
||||
List<String> tasksWithP8D = new ArrayList<>(Arrays.asList(
|
||||
"TKI:000000000000000000000000000000000008"
|
||||
));
|
||||
validateNewTaskProperties(before, tasksWithP8D, taskService, converter, 8);
|
||||
|
||||
List<String> tasksWithP14D = new ArrayList<>(Arrays.asList(
|
||||
"TKI:000000000000000000000000000000000010"
|
||||
));
|
||||
validateNewTaskProperties(before, tasksWithP14D, taskService, converter, 14);
|
||||
|
||||
List<String> tasksWithP15D = new ArrayList<>(
|
||||
Arrays.asList("TKI:000000000000000000000000000000000003", "TKI:000000000000000000000000000000000004",
|
||||
"TKI:000000000000000000000000000000000005", "TKI:000000000000000000000000000000000006",
|
||||
"TKI:000000000000000000000000000000000007",
|
||||
"TKI:000000000000000000000000000000000009", "TKI:000000000000000000000000000000000012",
|
||||
"TKI:000000000000000000000000000000000013", "TKI:000000000000000000000000000000000014",
|
||||
"TKI:000000000000000000000000000000000015", "TKI:000000000000000000000000000000000016",
|
||||
"TKI:000000000000000000000000000000000017", "TKI:000000000000000000000000000000000018",
|
||||
"TKI:000000000000000000000000000000000019", "TKI:000000000000000000000000000000000020",
|
||||
"TKI:000000000000000000000000000000000021", "TKI:000000000000000000000000000000000022",
|
||||
"TKI:000000000000000000000000000000000023", "TKI:000000000000000000000000000000000024",
|
||||
"TKI:000000000000000000000000000000000025", "TKI:000000000000000000000000000000000026",
|
||||
"TKI:000000000000000000000000000000000027", "TKI:000000000000000000000000000000000028",
|
||||
"TKI:000000000000000000000000000000000029", "TKI:000000000000000000000000000000000030",
|
||||
"TKI:000000000000000000000000000000000031", "TKI:000000000000000000000000000000000032",
|
||||
"TKI:000000000000000000000000000000000033", "TKI:000000000000000000000000000000000034",
|
||||
"TKI:000000000000000000000000000000000035", "TKI:000000000000000000000000000000000100",
|
||||
"TKI:000000000000000000000000000000000101", "TKI:000000000000000000000000000000000102",
|
||||
"TKI:000000000000000000000000000000000103"
|
||||
));
|
||||
validateNewTaskProperties(before, tasksWithP15D, taskService, converter, 15);
|
||||
|
||||
}
|
||||
|
||||
private void validateNewTaskProperties(Instant before, List<String> tasksWithP15D, TaskService taskService,
|
||||
DaysToWorkingDaysConverter converter, int serviceLevel) throws TaskNotFoundException, NotAuthorizedException {
|
||||
for (String taskId : tasksWithP15D) {
|
||||
Task task = taskService.getTask(taskId);
|
||||
assertTrue("Task " + task.getId() + " has not been refreshed.", task.getModified().isAfter(before));
|
||||
assertTrue(task.getPriority() == 1000);
|
||||
// the following excluded tasks are affected via attachments. The task or an attachment still has a service
|
||||
// level below 15 days
|
||||
// therefore, we cannot compare the due date of these tasks to an SL of 15 days.
|
||||
if (taskId.equals("TKI:000000000000000000000000000000000008")) {
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getPlanned(), 8);
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
// } else if (indirectlyAffectedTasks.contains(taskId)) {
|
||||
// long calendarDays = converter.convertWorkingDaysToDays(task.getPlanned(), 1);
|
||||
// assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
} else {
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getPlanned(), 15);
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
}
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getPlanned(), serviceLevel);
|
||||
|
||||
assertTrue("Task: " + taskId + ": Due Date " + task.getDue() + " does not match planned " + task.getPlanned()
|
||||
+ " + calendar days " + calendarDays,
|
||||
task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -152,8 +152,11 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
|
|||
assertThat(task.getAttachments().size(), equalTo(attachmentCount));
|
||||
assertThat(task.getAttachments().get(0).getChannel(), equalTo(newChannel));
|
||||
assertTrue(task.getPriority() == 999);
|
||||
assertTrue(task.getDue().equals(task.getPlanned()));
|
||||
|
||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter
|
||||
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getDue(), 1);
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
|
@ -297,8 +300,12 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
|
|||
assertThat(task.getAttachments().size(), equalTo(attachmentCount));
|
||||
assertThat(task.getAttachments().get(0).getChannel(), equalTo(newChannel));
|
||||
assertTrue(task.getPriority() == 999);
|
||||
assertTrue(task.getDue().equals(task.getPlanned()));
|
||||
|
||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter
|
||||
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getDue(), 1);
|
||||
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
|
@ -321,7 +328,11 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
|
|||
task = taskService.updateTask(task);
|
||||
task = taskService.getTask(task.getId());
|
||||
assertTrue(task.getPriority() == 101);
|
||||
assertTrue(task.getDue().equals(task.getPlanned()));
|
||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter
|
||||
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getDue(), 1);
|
||||
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
|
||||
assertThat(task.getAttachments().size(), equalTo(2));
|
||||
List<Attachment> attachments = task.getAttachments();
|
||||
|
@ -358,9 +369,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
|
|||
task = taskService.getTask(task.getId());
|
||||
assertTrue(task.getPriority() == 99);
|
||||
|
||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter
|
||||
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
|
||||
long calendarDays = converter.convertWorkingDaysToDays(task.getDue(), 16);
|
||||
calendarDays = converter.convertWorkingDaysToDays(task.getDue(), 16);
|
||||
|
||||
assertTrue(task.getDue().equals(task.getPlanned().plus(Duration.ofDays(calendarDays))));
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ public class ClassificationServiceImplIntAutoCommitTest {
|
|||
classificationService.createClassification(classification);
|
||||
all++;
|
||||
Classification classification1 = this.createDummyClassificationWithUniqueKey("", "TASK");
|
||||
classification1.setServiceLevel("P1DT1H");
|
||||
classification1.setServiceLevel("P1DT24H");
|
||||
classification1.setName("name1");
|
||||
classification1.setDescription("desc");
|
||||
classificationService.createClassification(classification1);
|
||||
|
@ -349,7 +349,7 @@ public class ClassificationServiceImplIntAutoCommitTest {
|
|||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1D").descriptionLike("desc").list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1DT1H").nameIn("name").list();
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1DT24H").nameIn("name").list();
|
||||
Assert.assertEquals(0, list.size());
|
||||
list = classificationService.createClassificationQuery().descriptionLike("desc%").list();
|
||||
Assert.assertEquals(all, list.size());
|
||||
|
|
|
@ -366,7 +366,7 @@ public class ClassificationServiceImplIntExplicitTest {
|
|||
classificationService.createClassification(classification);
|
||||
all++;
|
||||
Classification classification1 = this.createNewClassificationWithUniqueKey("", "TASK");
|
||||
classification1.setServiceLevel("P1DT1H");
|
||||
classification1.setServiceLevel("P1DT24H");
|
||||
classification1.setName("name1");
|
||||
classification1.setDescription("desc");
|
||||
classificationService.createClassification(classification1);
|
||||
|
@ -387,7 +387,7 @@ public class ClassificationServiceImplIntExplicitTest {
|
|||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1D").descriptionLike("desc").list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1DT1H").nameIn("name").list();
|
||||
list = classificationService.createClassificationQuery().serviceLevelIn("P1DT24H").nameIn("name").list();
|
||||
Assert.assertEquals(0, list.size());
|
||||
list = classificationService.createClassificationQuery().descriptionLike("desc%").list();
|
||||
Assert.assertEquals(all, list.size());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-- ID, KEY, PARENT_ID, PARENT_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 - 8
|
||||
-- ID, KEY, PARENT_ID, PARENT_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 - 8
|
||||
-- MASTER CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'PT5H', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'PT24H', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P2D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P3D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 7, 'P4D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
@ -21,7 +21,7 @@ INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000023', 'T
|
|||
INSERT INTO CLASSIFICATION VALUES('CLI:300000000000000000000000000000000017', 'L3060', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf neu', 'Widerruf neu', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_A CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 101, 'PT7H', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 101, 'PT24H', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P13D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P14D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'CLI:100000000000000000000000000000000004', 'L11010', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P15D', '', 'VNR,RVNR,KOLVNR', 'TEXT_1', '', '', '', '', '', '');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-- ID, KEY, PARENT_ID, PARENT_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 - 8
|
||||
-- ID, KEY, PARENT_ID, PARENT_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, MODIFIED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 - 8
|
||||
-- MASTER CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'PT5H', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'PT24H', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P2D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P3D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 7, 'P4D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
@ -21,7 +21,7 @@ INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000023', 'T
|
|||
INSERT INTO CLASSIFICATION VALUES('CLI:300000000000000000000000000000000017', 'L3060', '', '', 'EXTERNAL', 'TASK', '', FALSE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf neu', 'Widerruf neu', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_A CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 101, 'PT7H', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 101, 'PT24H', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P13D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', '', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P14D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'CLI:100000000000000000000000000000000004', 'L11010', 'EXTERNAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P15D', '', 'VNR,RVNR,KOLVNR', 'TEXT_1', '', '', '', '', '', '');
|
||||
|
|
Loading…
Reference in New Issue