Skip to content

Commit

Permalink
Runtime Bundle: Incorrect status for process instance when starting c…
Browse files Browse the repository at this point in the history
…reated process (Activiti#3463)

* Reproduce AAE-3508 using an Integration Test to debug further

* Update Execution.xml for update command to set startTime as HistoricProcessInstance.xml does

* Add a unit test for activiti engine and adjust integration test for duplicate assert statement
  • Loading branch information
amohammedalfresco authored Oct 20, 2020
1 parent e77c0f3 commit 58ec3c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
DEADLETTER_JOB_COUNT_ = #{deadLetterJobCount, jdbcType=INTEGER},
VAR_COUNT_ = #{variableCount, jdbcType=INTEGER},
ID_LINK_COUNT_ = #{identityLinkCount, jdbcType=INTEGER},
START_TIME_ = #{startTime, jdbcType=TIMESTAMP},
APP_VERSION_ = #{appVersion, jdbcType=INTEGER}
where ID_ = #{id, jdbcType=VARCHAR}
and REV_ = #{revision, jdbcType=INTEGER}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ public void testStartProcessInstanceByProcessInstanceBuilder() {
assertThat(processInstance.getBusinessKey()).isEqualTo("101124");
}

@Deployment(resources = {"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testProcessInstanceStartTimeUsingRuntimeService() {
ProcessInstance processInstance = runtimeService.createProcessInstanceBuilder()
.processDefinitionKey("oneTaskProcess")
.create();
assertThat(processInstance.getStartTime()).isNull();

runtimeService.startCreatedProcessInstance(processInstance, new HashMap<>());
processInstance = runtimeService.createProcessInstanceQuery()
.processInstanceId(processInstance.getProcessInstanceId())
.singleResult();
assertThat(processInstance.getStartTime()).isNotNull();
}

@Deployment(resources = {"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testNonUniqueBusinessKey() {
runtimeService.startProcessInstanceByKey("oneTaskProcess",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public void should_startAnAlreadyCreatedProcess_when_startCreatedProcessIsCalled
assertThat(RuntimeTestConfiguration.createdTasks).contains(tasks.getContent().get(0).getId());
assertThat(singleTaskProcessStarted).isNotNull();
assertThat(singleTaskProcessStarted.getStatus()).isEqualTo(ProcessInstance.ProcessInstanceStatus.RUNNING);
assertThat(processRuntime.processInstance(singleTaskProcessStarted.getId()).getStatus()).isEqualTo(ProcessInstance.ProcessInstanceStatus.RUNNING);
}

@Test
Expand Down

0 comments on commit 58ec3c2

Please sign in to comment.