diff --git a/engine/src/main/java/org/camunda/bpm/engine/externaltask/ExternalTask.java b/engine/src/main/java/org/camunda/bpm/engine/externaltask/ExternalTask.java index 59e90344efa..b505c94bf5c 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/externaltask/ExternalTask.java +++ b/engine/src/main/java/org/camunda/bpm/engine/externaltask/ExternalTask.java @@ -54,7 +54,7 @@ public interface ExternalTask { * @return the absolute time at which the task was created * @return */ - Date getCreationDate(); + Date getCreateTime(); /** * @return the id of the process instance the task exists in diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java b/engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java index ce816c10bac..3effe4e95b2 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java @@ -1258,7 +1258,7 @@ protected HistoricExternalTaskLogEntity initHistoricExternalTaskLog(ExternalTask } protected Date getTimestamp(ExternalTaskEntity entity, ExternalTaskState state) { - return state == ExternalTaskState.CREATED ? entity.getCreationDate() : ClockUtil.getCurrentTime(); + return state == ExternalTaskState.CREATED ? entity.getCreateTime() : ClockUtil.getCurrentTime(); } protected boolean isRootProcessInstance(HistoricProcessInstanceEventEntity evt) { diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskEntity.java b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskEntity.java index abc19983bad..303464928ae 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskEntity.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskEntity.java @@ -72,7 +72,7 @@ public class ExternalTaskEntity implements ExternalTask, DbEntity, protected String topicName; protected String workerId; protected Date lockExpirationTime; - protected Date creationDate; + protected Date createTime; protected Integer retries; protected String errorMessage; @@ -130,12 +130,12 @@ public void setLockExpirationTime(Date lockExpirationTime) { } @Override - public Date getCreationDate() { - return creationDate; + public Date getCreateTime() { + return createTime; } - public void setCreationDate(Date creationDate) { - this.creationDate = creationDate; + public void setCreateTime(Date createTime) { + this.createTime = createTime; } @Override @@ -576,7 +576,7 @@ public static ExternalTaskEntity createAndInsert(ExecutionEntity execution, Stri externalTask.setActivityInstanceId(execution.getActivityInstanceId()); externalTask.setTenantId(execution.getTenantId()); externalTask.setPriority(priority); - externalTask.setCreationDate(ClockUtil.getCurrentTime()); + externalTask.setCreateTime(ClockUtil.getCurrentTime()); ProcessDefinitionEntity processDefinition = execution.getProcessDefinition(); externalTask.setProcessDefinitionKey(processDefinition.getKey()); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/ExternalTask.xml b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/ExternalTask.xml index 05bdb8ad7c1..af480769d97 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/ExternalTask.xml +++ b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/ExternalTask.xml @@ -31,7 +31,7 @@ - + @@ -58,7 +58,7 @@ WORKER_ID_, TOPIC_NAME_, LOCK_EXP_TIME_, - CREATION_DATE_, + CREATE_TIME_, RETRIES_, ERROR_MSG_, ERROR_DETAILS_ID_, @@ -78,7 +78,7 @@ #{workerId, jdbcType=VARCHAR}, #{topicName, jdbcType=VARCHAR}, #{lockExpirationTime, jdbcType=TIMESTAMP}, - #{creationDate, jdbcType=TIMESTAMP}, + #{createTime, jdbcType=TIMESTAMP}, #{retries, jdbcType=INTEGER}, #{errorMessage, jdbcType=VARCHAR}, #{errorDetailsByteArrayId, jdbcType=VARCHAR}, @@ -445,7 +445,7 @@ RES.TOPIC_NAME_, RES.WORKER_ID_, RES.LOCK_EXP_TIME_, - RES.CREATION_DATE_, + RES.CREATE_TIME_, RES.RETRIES_, RES.ERROR_MSG_, RES.ERROR_DETAILS_ID_, diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreationDateTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreateTimeTest.java similarity index 87% rename from engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreationDateTest.java rename to engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreateTimeTest.java index 97cd5796981..e2a422c1f4a 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreationDateTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskQueryByCreateTimeTest.java @@ -42,7 +42,7 @@ import org.junit.rules.RuleChain; @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) -public class ExternalTaskQueryByCreationDateTest { +public class ExternalTaskQueryByCreateTimeTest { public ProcessEngineRule engineRule = new ProvidedProcessEngineRule(); public ProcessEngineTestRule testHelper = new ProcessEngineTestRule(engineRule); @@ -74,7 +74,7 @@ public void init() { } @Test - public void shouldHaveNonNullCreationDate() { + public void shouldHaveNonNullCreateTime() { // given runtimeService.startProcessInstanceByKey("process1"); @@ -85,11 +85,11 @@ public void shouldHaveNonNullCreationDate() { // then assertThat(result.size()).isEqualTo(1); - assertThat(result.get(0).getCreationDate()).isNotNull(); + assertThat(result.get(0).getCreateTime()).isNotNull(); } @Test - public void shouldProduceEventWithCreationDateValue() { + public void shouldProduceEventWithCreateTimeValue() { // given runtimeService.startProcessInstanceByKey("process1"); @@ -105,7 +105,7 @@ public void shouldProduceEventWithCreationDateValue() { var historyEventTimestamp = result.get(0).getTimestamp(); // then - assertThat(extTask.getCreationDate()).isEqualTo(historyEventTimestamp); + assertThat(extTask.getCreateTime()).isEqualTo(historyEventTimestamp); } @Test @@ -117,7 +117,7 @@ public void shouldReturnTasksInDescOrder() { var result = engineRule.getExternalTaskService() .createExternalTaskQuery() // when - .orderByCreationDate().desc() + .orderByCreateTime().desc() .list(); assertThat(result.size()).isEqualTo(2); @@ -126,8 +126,8 @@ public void shouldReturnTasksInDescOrder() { var extTask2 = result.get(1); // then - assertThat(extTask2.getCreationDate()) - .isBefore(extTask1.getCreationDate()); + assertThat(extTask2.getCreateTime()) + .isBefore(extTask1.getCreateTime()); } @Test @@ -139,7 +139,7 @@ public void shouldReturnTasksInAscOrder() { var result = engineRule.getExternalTaskService() .createExternalTaskQuery() // when - .orderByCreationDate().asc() + .orderByCreateTime().asc() .list(); assertThat(result.size()).isEqualTo(2); @@ -148,14 +148,14 @@ public void shouldReturnTasksInAscOrder() { var extTask2 = result.get(1); // then - assertThat(extTask1.getCreationDate()) - .isBefore(extTask2.getCreationDate()); + assertThat(extTask1.getCreateTime()) + .isBefore(extTask2.getCreateTime()); } - // Multi-Level Sorting with CreationDate & Priority + // Multi-Level Sorting with CreateTime & Priority @Test - public void shouldReturnTasksInCreationDateAscOrderOnPriorityEquality() { + public void shouldReturnTasksInCreateTimeAscOrderOnPriorityEquality() { // given startProcessInstanceAfter("process1", 1); startProcessInstanceAfter("process2", 1); @@ -166,7 +166,7 @@ public void shouldReturnTasksInCreationDateAscOrderOnPriorityEquality() { .createExternalTaskQuery() // when .orderByPriority().desc() - .orderByCreationDate().asc() + .orderByCreateTime().asc() .list(); @@ -180,7 +180,7 @@ public void shouldReturnTasksInCreationDateAscOrderOnPriorityEquality() { } @Test - public void shouldReturnTasksInCreationDateDescOrderOnPriorityEquality() { + public void shouldReturnTasksInCreateTimeDescOrderOnPriorityEquality() { // given startProcessInstanceAfter("process1", 1); startProcessInstanceAfter("process2", 1); @@ -191,7 +191,7 @@ public void shouldReturnTasksInCreationDateDescOrderOnPriorityEquality() { .createExternalTaskQuery() // when .orderByPriority().desc() - .orderByCreationDate().desc() + .orderByCreateTime().desc() .list(); @@ -200,12 +200,12 @@ public void shouldReturnTasksInCreationDateDescOrderOnPriorityEquality() { // then assertThat(result.get(0).getActivityId()).isEqualTo("task1"); // due to priority DESC assertThat(result.get(1).getActivityId()).isEqualTo("task2"); - assertThat(result.get(2).getActivityId()).isEqualTo("task4"); // due to creationDate DESC + assertThat(result.get(2).getActivityId()).isEqualTo("task4"); // due to CreateTime DESC assertThat(result.get(3).getActivityId()).isEqualTo("task3"); } @Test - public void shouldReturnTasksInPriorityAscOnCreationDateEquality() { + public void shouldReturnTasksInPriorityAscOnCreateTimeEquality() { var now = ClockTestUtil.setClockToDateWithoutMilliseconds(); // given @@ -218,7 +218,7 @@ public void shouldReturnTasksInPriorityAscOnCreationDateEquality() { var result = engineRule.getExternalTaskService() .createExternalTaskQuery() // when - .orderByCreationDate().asc() + .orderByCreateTime().asc() .orderByPriority().asc() .list(); @@ -226,7 +226,7 @@ public void shouldReturnTasksInPriorityAscOnCreationDateEquality() { assertThat(result.size()).isEqualTo(4); // then - assertThat(result.get(0).getActivityId()).isEqualTo("task2"); // due to creationDate Equality, priority ASC + assertThat(result.get(0).getActivityId()).isEqualTo("task2"); // due to CreateTime Equality, priority ASC assertThat(result.get(1).getActivityId()).isEqualTo("task1"); assertThat(result.get(2).getActivityId()).isEqualTo("task3"); @@ -234,7 +234,7 @@ public void shouldReturnTasksInPriorityAscOnCreationDateEquality() { } @Test - public void shouldReturnTasksInPriorityDescOnCreationDateEquality() { + public void shouldReturnTasksInPriorityDescOnCreateTimeEquality() { var now = ClockTestUtil.setClockToDateWithoutMilliseconds(); // given @@ -247,7 +247,7 @@ public void shouldReturnTasksInPriorityDescOnCreationDateEquality() { var result = engineRule.getExternalTaskService() .createExternalTaskQuery() // when - .orderByCreationDate().asc() + .orderByCreateTime().asc() .orderByPriority().desc() .list(); @@ -255,7 +255,7 @@ public void shouldReturnTasksInPriorityDescOnCreationDateEquality() { assertThat(result.size()).isEqualTo(4); // then - assertThat(result.get(0).getActivityId()).isEqualTo("task1"); // due to creationDate equality, priority DESC + assertThat(result.get(0).getActivityId()).isEqualTo("task1"); // due to CreateTime equality, priority DESC assertThat(result.get(1).getActivityId()).isEqualTo("task2"); assertThat(result.get(2).getActivityId()).isEqualTo("task3");