diff --git a/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.ftl b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.ftl index 57919f2efc7..87ad6a62b30 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.ftl @@ -12,6 +12,11 @@ type = "string" desc = "The id of the process definition that this process instance belongs to." /> + <@lib.property + name = "definitionKey" + type = "string" + desc = "The key of the process definition that this process instance belongs to." /> + <@lib.property name = "businessKey" type = "string" @@ -40,4 +45,4 @@ desc = "The tenant id of the process instance." /> - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/condition/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/condition/post.ftl index 5ec0fd60029..c3265a491ae 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/condition/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/condition/post.ftl @@ -39,6 +39,7 @@ "links": [], "id": "aProcInstId", "definitionId": "aProcDefId", + "definitionKey": "aProcDefKey", "businessKey": "aBusinessKey", "caseInstanceId": null, "ended": false, @@ -49,6 +50,7 @@ "links": [], "id": "anotherId", "definitionId": "aProcDefId", + "definitionKey": "aProcDefKey", "businessKey": "aBusinessKey", "caseInstanceId": null, "ended": false, @@ -71,4 +73,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/message/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/message/post.ftl index 8479acf423e..191459468b4 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/message/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/message/post.ftl @@ -89,6 +89,7 @@ "links": [], "id": "aProcInstId", "definitionId": "aProcDefId", + "definitionKey": "aProcDefKey", "businessKey": "aKey", "caseInstanceId": "aCaseInstId", "ended": false, @@ -137,4 +138,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/start/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/start/post.ftl index d167f29f5c9..69fab658647 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/start/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/start/post.ftl @@ -114,6 +114,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -134,6 +135,7 @@ ], "id": "aProcInstId", "definitionId": "aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey": "myBusinessKey", "caseInstanceId": null, "ended": false, @@ -168,6 +170,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -196,4 +199,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/submit-form/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/submit-form/post.ftl index ef01fa4113d..5add06e8dda 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/submit-form/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/submit-form/post.ftl @@ -62,6 +62,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -99,4 +100,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/start/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/start/post.ftl index 198165a030c..304e307aa8c 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/start/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/start/post.ftl @@ -120,6 +120,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -140,6 +141,7 @@ ], "id": "aProcInstId", "definitionId": "aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey": "myBusinessKey", "caseInstanceId": null, "ended": false, @@ -174,6 +176,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -202,4 +205,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/submit-form/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/submit-form/post.ftl index b8cf46ea14d..71190939ee8 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/submit-form/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/key/{key}/tenant-id/{tenant-id}/submit-form/post.ftl @@ -69,6 +69,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -106,4 +107,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/start/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/start/post.ftl index 15d5b9e358d..4807fbe2715 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/start/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/start/post.ftl @@ -113,6 +113,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -133,6 +134,7 @@ ], "id": "aProcInstId", "definitionId": "aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey": "myBusinessKey", "caseInstanceId": null, "ended": false, @@ -167,6 +169,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -195,4 +198,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/submit-form/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/submit-form/post.ftl index 528e2f95d26..f4059fc87ad 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/submit-form/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-definition/{id}/submit-form/post.ftl @@ -61,6 +61,7 @@ ], "id":"anId", "definitionId":"aProcessDefinitionId", + "definitionKey":"aProcessDefinitionKey", "businessKey":"myBusinessKey", "caseInstanceId": null, "tenantId":null, @@ -98,4 +99,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/get.ftl index 307a176bebf..de25976f184 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/get.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/get.ftl @@ -34,6 +34,7 @@ "links": [], "id": "anId", "definitionId": "aProcDefId", + "definitionKey": "aProcDefKey", "businessKey": "aKey", "caseInstanceId": "aCaseInstanceId", "ended": false, @@ -53,4 +54,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/post.ftl index 2b071dc7a2d..a52e08a5c82 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/post.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/post.ftl @@ -60,6 +60,7 @@ "links": [], "id": "anId", "definitionId": "aProcessDefinitionId", + "definitionKey": "aProcessDefinitionKey", "businessKey": "aKey", "caseInstanceId": "aCaseInstanceId", "ended": false, @@ -80,4 +81,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/get.ftl index 7f89c4bafe9..933bdffa4c4 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/get.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/process-instance/{id}/get.ftl @@ -28,6 +28,7 @@ "value": { "id":"aProcessInstanceId", "definitionId":"aProcDefId", + "definitionKey":"aProcDefKey", "businessKey":"aKey", "caseInstanceId":"aCaseInstanceId", "ended":false, @@ -45,4 +46,4 @@ } } - \ No newline at end of file + diff --git a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.java b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.java index e7461c640ea..575ac30bdae 100644 --- a/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.java +++ b/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.java @@ -28,6 +28,7 @@ public class ProcessInstanceDto extends LinkableDto { private boolean ended; private boolean suspended; private String tenantId; + private String definitionKey; public ProcessInstanceDto() { } @@ -35,6 +36,7 @@ public ProcessInstanceDto() { public ProcessInstanceDto(ProcessInstance instance) { this.id = instance.getId(); this.definitionId = instance.getProcessDefinitionId(); + this.definitionKey = instance.getProcessDefinitionKey(); this.businessKey = instance.getBusinessKey(); this.caseInstanceId = instance.getCaseInstanceId(); this.ended = instance.isEnded(); @@ -50,6 +52,10 @@ public String getDefinitionId() { return definitionId; } + public String getDefinitionKey() { + return definitionKey; + } + public String getBusinessKey() { return businessKey; } diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ConditionRestServiceTest.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ConditionRestServiceTest.java index d5557e73677..f79ac931f54 100644 --- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ConditionRestServiceTest.java +++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ConditionRestServiceTest.java @@ -276,8 +276,11 @@ public void shouldReturnErrorCode() { protected void checkResult(String content) { Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID, from(content).get("[" + 0 + "].id")); Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, from(content).get("[" + 0+ "].definitionId")); + Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY, from(content).get("[" + 0+ "].definitionKey")); Assert.assertEquals(MockProvider.ANOTHER_EXAMPLE_PROCESS_INSTANCE_ID, from(content).get("[" + 1 + "].id")); Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, from(content).get("[" + 1+ "].definitionId")); + Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY, from(content).get("[" + 1+ "].definitionKey")); + } } diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/MessageRestServiceTest.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/MessageRestServiceTest.java index 52d20d5731e..d8519ed52af 100644 --- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/MessageRestServiceTest.java +++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/MessageRestServiceTest.java @@ -263,6 +263,7 @@ protected void checkProcessInstanceResult(String content, int idx) { //process instance should be filled and execution should be null Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID, from(content).get("[" + idx + "].processInstance.id")); Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, from(content).get("[" + idx + "].processInstance.definitionId")); + Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY, from(content).get("[" + idx + "].processInstance.definitionKey")); Assert.assertNull(from(content).get("[" + idx + "].execution")); } diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessInstanceRestServiceInteractionTest.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessInstanceRestServiceInteractionTest.java index 8c966c1c70b..30a9e332e84 100644 --- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessInstanceRestServiceInteractionTest.java +++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessInstanceRestServiceInteractionTest.java @@ -1424,6 +1424,7 @@ public void testGetSingleInstance() { .body("id", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)) .body("ended", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_IS_ENDED)) .body("definitionId", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)) + .body("definitionKey", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY)) .body("businessKey", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY)) .body("suspended", Matchers.equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_IS_SUSPENDED)) .body("tenantId", Matchers.equalTo(MockProvider.EXAMPLE_TENANT_ID)) diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/MockProvider.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/MockProvider.java index 18e8fedb054..99df67cfe0c 100644 --- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/MockProvider.java +++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/MockProvider.java @@ -1317,6 +1317,7 @@ public static ProcessInstance createMockInstance(String tenantId) { when(mock.getBusinessKey()).thenReturn(EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY); when(mock.getCaseInstanceId()).thenReturn(EXAMPLE_CASE_INSTANCE_ID); when(mock.getProcessDefinitionId()).thenReturn(EXAMPLE_PROCESS_DEFINITION_ID); + when(mock.getProcessDefinitionKey()).thenReturn(EXAMPLE_PROCESS_DEFINITION_KEY); when(mock.getProcessInstanceId()).thenReturn(EXAMPLE_PROCESS_INSTANCE_ID); when(mock.isSuspended()).thenReturn(EXAMPLE_PROCESS_INSTANCE_IS_SUSPENDED); when(mock.isEnded()).thenReturn(EXAMPLE_PROCESS_INSTANCE_IS_ENDED); @@ -2341,6 +2342,7 @@ public static ProcessInstance createAnotherMockInstance() { when(mock.getId()).thenReturn(ANOTHER_EXAMPLE_PROCESS_INSTANCE_ID); when(mock.getBusinessKey()).thenReturn(EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY); when(mock.getProcessDefinitionId()).thenReturn(EXAMPLE_PROCESS_DEFINITION_ID); + when(mock.getProcessDefinitionKey()).thenReturn(EXAMPLE_PROCESS_DEFINITION_KEY); when(mock.getProcessInstanceId()).thenReturn(ANOTHER_EXAMPLE_PROCESS_INSTANCE_ID); when(mock.isSuspended()).thenReturn(EXAMPLE_PROCESS_INSTANCE_IS_SUSPENDED); when(mock.isEnded()).thenReturn(EXAMPLE_PROCESS_INSTANCE_IS_ENDED); diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java index 5da5887b70b..ace55e40cdc 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java @@ -239,6 +239,11 @@ public class ExecutionEntity extends PvmExecutionImpl implements Execution, Proc */ protected String restartedProcessInstanceId; + /** + * The name of the process definition key + */ + protected String processDefinitionKey; + /** * Contains observers which are observe the execution. * @since 7.6 @@ -268,6 +273,7 @@ public ExecutionEntity createExecution() { // initialize the new execution createdExecution.setProcessDefinition(getProcessDefinition()); + createdExecution.setProcessDefinitionKey(getProcessDefinitionKey()); createdExecution.setProcessInstance(getProcessInstance()); createdExecution.setActivity(getActivity()); createdExecution.setSuspensionState(getSuspensionState()); @@ -525,6 +531,7 @@ public void destroy(boolean alwaysSkipIoMappings) { removeEventSubscriptionsExceptCompensation(); } + @Override public void removeAllTasks() { // delete all the tasks removeTasks(); @@ -553,6 +560,7 @@ protected void clearExecution() { removeIncidents(); } + @Override public void removeVariablesLocalInternal() { for (VariableInstanceEntity variableInstance : variableStore.getVariables()) { invokeVariableLifecycleListenersDelete( @@ -753,6 +761,7 @@ public void setProcessDefinitionId(String processDefinitionId) { this.processDefinitionId = processDefinitionId; } + @Override public String getProcessDefinitionId() { return processDefinitionId; } @@ -774,9 +783,13 @@ public void setProcessDefinition(ProcessDefinitionImpl processDefinition) { this.processDefinition = processDefinition; if (processDefinition != null) { this.processDefinitionId = processDefinition.getId(); + if (processDefinition instanceof ProcessDefinitionEntity) { + this.processDefinitionKey = ((ProcessDefinitionEntity) processDefinition).getKey(); + } } else { this.processDefinitionId = null; + this.processDefinitionKey = null; } } @@ -819,6 +832,7 @@ public boolean isProcessInstanceExecution() { return parentId == null; } + @Override public boolean isProcessInstanceStarting() { // the process instance can only be starting if it is currently in main-memory already // we never have to access the database @@ -1265,6 +1279,7 @@ public Collection provideVariables() { return Context.getCommandContext().getVariableInstanceManager().findVariableInstancesByExecutionId(id); } + @Override public Collection provideVariables(Collection variableNames) { return Context.getCommandContext().getVariableInstanceManager().findVariableInstancesByExecutionIdAndVariableNames(id, variableNames); } @@ -1430,6 +1445,7 @@ public void restoreProcessInstance(Collection executions, // persistent state ///////////////////////////////////////////////////////// + @Override public Object getPersistentState() { Map persistentState = new HashMap<>(); persistentState.put("processDefinitionId", this.processDefinitionId); @@ -1447,6 +1463,7 @@ public Object getPersistentState() { persistentState.put("suspensionState", this.suspensionState); persistentState.put("cachedEntityState", getCachedEntityState()); persistentState.put("sequenceCounter", getSequenceCounter()); + persistentState.put("processDefinitionKey", this.processDefinitionKey); return persistentState; } @@ -1454,10 +1471,12 @@ public void insert() { Context.getCommandContext().getExecutionManager().insertExecution(this); } + @Override public int getRevisionNext() { return revision + 1; } + @Override public void forceUpdate() { Context.getCommandContext().getDbEntityManager().forceUpdate(this); } @@ -1791,6 +1810,7 @@ public int getCachedEntityStateRaw() { return cachedEntityState; } + @Override public String getRootProcessInstanceId() { if (isProcessInstanceExecution()) { return rootProcessInstanceId; @@ -1808,6 +1828,7 @@ public void setRootProcessInstanceId(String rootProcessInstanceId) { this.rootProcessInstanceId = rootProcessInstanceId; } + @Override public String getProcessInstanceId() { return processInstanceId; } @@ -1829,10 +1850,12 @@ public void setParentId(String parentId) { this.parentId = parentId; } + @Override public int getRevision() { return revision; } + @Override public void setRevision(int revision) { this.revision = revision; } @@ -1887,6 +1910,7 @@ public void setSuspensionState(int suspensionState) { this.suspensionState = suspensionState; } + @Override public boolean isSuspended() { return suspensionState == SuspensionState.SUSPENDED.getStateCode(); } @@ -1901,6 +1925,7 @@ public String getCurrentActivityName() { return activityName; } + @Override public FlowElement getBpmnModelElementInstance() { BpmnModelInstance bpmnModelInstance = getBpmnModelInstance(); if (bpmnModelInstance != null) { @@ -1926,6 +1951,7 @@ public FlowElement getBpmnModelElementInstance() { } } + @Override public BpmnModelInstance getBpmnModelInstance() { if (processDefinitionId != null) { return Context.getProcessEngineConfiguration().getDeploymentCache().findBpmnModelInstanceForProcessDefinition(processDefinitionId); @@ -1936,6 +1962,7 @@ public BpmnModelInstance getBpmnModelInstance() { } } + @Override public ProcessEngineServices getProcessEngineServices() { return Context.getProcessEngineConfiguration().getProcessEngine(); } @@ -1948,4 +1975,13 @@ public ProcessEngine getProcessEngine() { public String getProcessDefinitionTenantId() { return getProcessDefinition().getTenantId(); } + + public void setProcessDefinitionKey(String processDefinitionKey) { + this.processDefinitionKey = processDefinitionKey; + } + + @Override + public String getProcessDefinitionKey() { + return processDefinitionKey; + } } diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessInstanceWithVariablesImpl.java b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessInstanceWithVariablesImpl.java index 080c6c8705a..848b3eff95b 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessInstanceWithVariablesImpl.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessInstanceWithVariablesImpl.java @@ -86,4 +86,9 @@ public String getProcessInstanceId() { public String getTenantId() { return executionEntity.getTenantId(); } + + @Override + public String getProcessDefinitionKey() { + return executionEntity.getProcessDefinitionKey(); + } } diff --git a/engine/src/main/java/org/camunda/bpm/engine/runtime/Execution.java b/engine/src/main/java/org/camunda/bpm/engine/runtime/Execution.java index 2c78e6b6e4c..1cbae07dd64 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/runtime/Execution.java +++ b/engine/src/main/java/org/camunda/bpm/engine/runtime/Execution.java @@ -52,4 +52,9 @@ public interface Execution { */ String getTenantId(); + /** + * The Key of the process definition. + */ + String getProcessDefinitionKey(); + } diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.db2.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.db2.create.engine.sql index 30f3fd07859..d11ca85d878 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.db2.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.db2.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ integer, SEQUENCE_COUNTER_ bigint, TENANT_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), primary key (ID_) ); @@ -595,4 +596,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.h2.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.h2.create.engine.sql index bc7e32606a8..84ec69f3f9f 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.h2.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.h2.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ integer, SEQUENCE_COUNTER_ integer, TENANT_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), primary key (ID_) ); @@ -586,4 +587,4 @@ alter table ACT_RU_VARIABLE -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mariadb.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mariadb.create.engine.sql index bedc6bbda37..b460001da14 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mariadb.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mariadb.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ integer, SEQUENCE_COUNTER_ bigint, TENANT_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), primary key (ID_) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; @@ -587,4 +588,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mssql.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mssql.create.engine.sql index c7c19f60c1f..bddd70c45a2 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mssql.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mssql.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ int, SEQUENCE_COUNTER_ numeric(19,0), TENANT_ID_ nvarchar(64), + PROC_DEF_KEY_ nvarchar(255), primary key (ID_) ); @@ -591,4 +592,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mysql.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mysql.create.engine.sql index 50ad4c10075..abbba80d311 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mysql.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.mysql.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ integer, SEQUENCE_COUNTER_ bigint, TENANT_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), primary key (ID_) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; @@ -587,4 +588,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.oracle.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.oracle.create.engine.sql index 235009f074e..b25d35d87f0 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.oracle.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.oracle.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ INTEGER, SEQUENCE_COUNTER_ NUMBER(19,0), TENANT_ID_ NVARCHAR2(64), + PROC_DEF_KEY_ NVARCHAR2(255), primary key (ID_) ); @@ -606,4 +607,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.postgres.create.engine.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.postgres.create.engine.sql index 5d73df89922..277e1fc5421 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.postgres.create.engine.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.postgres.create.engine.sql @@ -98,6 +98,7 @@ create table ACT_RU_EXECUTION ( CACHED_ENT_STATE_ integer, SEQUENCE_COUNTER_ bigint, TENANT_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), primary key (ID_) ); @@ -601,4 +602,4 @@ create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); -create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); \ No newline at end of file +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/db2_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/db2_engine_7.22_to_7.23.sql index c8829377542..24890e178ee 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/db2_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/db2_engine_7.22_to_7.23.sql @@ -21,3 +21,5 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add column REV_ integer not null default 1; + +alter table ACT_RU_EXECUTION add PROC_DEF_KEY_ varchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/h2_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/h2_engine_7.22_to_7.23.sql index f615c7b2975..24890e178ee 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/h2_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/h2_engine_7.22_to_7.23.sql @@ -22,3 +22,4 @@ alter table ACT_HI_COMMENT add column REV_ integer not null default 1; +alter table ACT_RU_EXECUTION add PROC_DEF_KEY_ varchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mariadb_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mariadb_engine_7.22_to_7.23.sql index c8829377542..24890e178ee 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mariadb_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mariadb_engine_7.22_to_7.23.sql @@ -21,3 +21,5 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add column REV_ integer not null default 1; + +alter table ACT_RU_EXECUTION add PROC_DEF_KEY_ varchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mssql_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mssql_engine_7.22_to_7.23.sql index 60f293be989..80e488a9f8a 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mssql_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mssql_engine_7.22_to_7.23.sql @@ -20,4 +20,6 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add REV_ integer - not null default 1; \ No newline at end of file + not null default 1; + +alter table ACT_RU_EXECUTION add PROC_DEF_KEY_ nvarchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mysql_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mysql_engine_7.22_to_7.23.sql index 87f8944c858..4f564017363 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mysql_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/mysql_engine_7.22_to_7.23.sql @@ -21,3 +21,5 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add column REV_ INTEGER not null default 1; + +alter table ACT_RU_EXECUTION add column PROC_DEF_KEY_ varchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/oracle_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/oracle_engine_7.22_to_7.23.sql index 298612a40ef..8152f9d94ca 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/oracle_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/oracle_engine_7.22_to_7.23.sql @@ -20,3 +20,5 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add REV_ integer default 1 not null; + +alter table ACT_RU_EXECUTION add PROC_DEF_KEY_ NVARCHAR2(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/postgres_engine_7.22_to_7.23.sql b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/postgres_engine_7.22_to_7.23.sql index c8829377542..4f51ae734e2 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/postgres_engine_7.22_to_7.23.sql +++ b/engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/postgres_engine_7.22_to_7.23.sql @@ -21,3 +21,5 @@ values ('1200', CURRENT_TIMESTAMP, '7.23.0'); alter table ACT_HI_COMMENT add column REV_ integer not null default 1; + +alter table ACT_RU_EXECUTION add column PROC_DEF_KEY_ varchar(255); diff --git a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml index 83e03d773e4..728804e5e29 100644 --- a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml +++ b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml @@ -45,6 +45,7 @@ CACHED_ENT_STATE_, SEQUENCE_COUNTER_, TENANT_ID_, + PROC_DEF_KEY_, REV_ ) values @@ -68,6 +69,7 @@ #{cachedEntityState, jdbcType=INTEGER}, #{sequenceCounter, jdbcType=BIGINT}, #{tenantId, jdbcType=VARCHAR}, + #{processDefinitionKey, jdbcType=VARCHAR}, 1 ) @@ -90,7 +92,8 @@ SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER}, CACHED_ENT_STATE_ = #{cachedEntityState, jdbcType=INTEGER}, SEQUENCE_COUNTER_ = #{sequenceCounter, jdbcType=BIGINT}, - TENANT_ID_ = #{tenantId, jdbcType=BIGINT} + TENANT_ID_ = #{tenantId, jdbcType=BIGINT}, + PROC_DEF_KEY_ = #{processDefinitionKey, jdbcType=VARCHAR} where ID_ = #{id, jdbcType=VARCHAR} and REV_ = #{revision, jdbcType=INTEGER} @@ -155,6 +158,7 @@ + diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ExecutionQueryTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ExecutionQueryTest.java index d73785530cc..bc79a0d3b6e 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ExecutionQueryTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ExecutionQueryTest.java @@ -98,6 +98,7 @@ public void testQueryByProcessDefinitionKey() { // Concurrent process with 3 executions for each process instance assertEquals(12, runtimeService.createExecutionQuery().processDefinitionKey(CONCURRENT_PROCESS_KEY).list().size()); assertEquals(1, runtimeService.createExecutionQuery().processDefinitionKey(SEQUENTIAL_PROCESS_KEY).list().size()); + assertNotNull(runtimeService.createExecutionQuery().processDefinitionKey(SEQUENTIAL_PROCESS_KEY).singleResult().getProcessDefinitionKey()); } @Test diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ProcessInstanceQueryTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ProcessInstanceQueryTest.java index 713c4d9ecc6..64fddca85c5 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ProcessInstanceQueryTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ProcessInstanceQueryTest.java @@ -208,9 +208,11 @@ public void testQueryNoSpecificsSingleResult() { @Test public void testQueryByProcessDefinitionKeySingleResult() { ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey(PROCESS_DEFINITION_KEY_2); + ProcessInstance processInstance = query.singleResult(); assertEquals(1, query.count()); assertEquals(1, query.list().size()); - assertNotNull(query.singleResult()); + assertNotNull(processInstance); + assertEquals(PROCESS_DEFINITION_KEY_2, processInstance.getProcessDefinitionKey()); } @Test diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/conditional/ConditionalStartEventTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/conditional/ConditionalStartEventTest.java index 09a34bba9a8..453a501d873 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/conditional/ConditionalStartEventTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/conditional/ConditionalStartEventTest.java @@ -489,6 +489,7 @@ public void testStartInstanceWithTrueConditionalStartEvent() { List processInstances = runtimeService.createProcessInstanceQuery().processDefinitionKey(TRUE_CONDITION_PROCESS).list(); assertEquals(1, processInstances.size()); + assertEquals(TRUE_CONDITION_PROCESS, processInstances.get(0).getProcessDefinitionKey()); assertEquals(processInstances.get(0).getId(), conditionInstances.get(0).getId()); } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/message/MessageStartEventTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/message/MessageStartEventTest.java index 8a62ee92f37..384a3a009b1 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/message/MessageStartEventTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/message/MessageStartEventTest.java @@ -172,6 +172,7 @@ public void testSingleMessageStartEvent() { taskService.complete(task.getId()); testRule.assertProcessEnded(processInstance.getId()); + assertEquals("singleMessageStartEvent", processInstance.getProcessDefinitionKey()); // using startProcessInstanceByKey also triggers the message event, if there is a single start event @@ -185,6 +186,7 @@ public void testSingleMessageStartEvent() { taskService.complete(task.getId()); testRule.assertProcessEnded(processInstance.getId()); + assertEquals("singleMessageStartEvent", processInstance.getProcessDefinitionKey()); } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/timer/StartTimerEventTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/timer/StartTimerEventTest.java index 7b9a2ff271b..6f59abdd6ac 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/timer/StartTimerEventTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/event/timer/StartTimerEventTest.java @@ -102,6 +102,7 @@ public void testDurationStartTimerEvent() throws Exception { List pi = runtimeService.createProcessInstanceQuery().processDefinitionKey("startTimerEventExample").list(); assertEquals(1, pi.size()); + assertEquals("startTimerEventExample", pi.get(0).getProcessDefinitionKey()); assertEquals(0, jobQuery.count()); diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/standalone/entity/ExecutionEntityTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/standalone/entity/ExecutionEntityTest.java index 94bd35929df..b8c9bdb0297 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/standalone/entity/ExecutionEntityTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/standalone/entity/ExecutionEntityTest.java @@ -109,8 +109,8 @@ public void testRemoveExecutionSequence() { // when assertNotNull(execution); assertEquals(pi.getId(), execution.getProcessInstanceId()); + assertEquals("singleTaskProcess", pi.getProcessDefinitionKey()); processEngineRule.getRuntimeService().signal(execution.getId()); - // then (see #TestLocalVariableTaskListener::notify) } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/util/ExecutionTree.java b/engine/src/test/java/org/camunda/bpm/engine/test/util/ExecutionTree.java index a35e07aeb7b..189410b1496 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/util/ExecutionTree.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/util/ExecutionTree.java @@ -176,4 +176,9 @@ protected static String executionTreeToString(ExecutionTree executionTree) { return sb.toString(); } + @Override + public String getProcessDefinitionKey() { + return wrappedExecution.getProcessDefinitionKey(); + } + }