Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/git issue 4049 process instance pdk api enhancement #4792

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e0d946f
Update Execution.xml
Nandanrshenoy Oct 4, 2024
5db3258
Update ExecutionEntity.java
Nandanrshenoy Oct 4, 2024
7baa39a
Update ProcessInstance.java
Nandanrshenoy Oct 4, 2024
59d04f5
Update ProcessInstanceWithVariablesImpl.java
Nandanrshenoy Oct 4, 2024
8b2d085
Update ProcessInstanceDto.java
Nandanrshenoy Oct 4, 2024
5cc095a
Update ProcessInstanceDto.ftl
Nandanrshenoy Oct 4, 2024
68f8a57
Update get.ftl
Nandanrshenoy Oct 4, 2024
7031eed
Update get.ftl
Nandanrshenoy Oct 4, 2024
42b6465
Update post.ftl
Nandanrshenoy Oct 4, 2024
b5c05a2
Update ProcessInstanceRestServiceInteractionTest.java
Nandanrshenoy Oct 4, 2024
06db7fe
Update ProcessInstanceDto.java
Nandanrshenoy Oct 4, 2024
7c7a4b1
Update activiti.db2.create.engine.sql
Nandanrshenoy Oct 4, 2024
63f5c9c
Update activiti.h2.create.engine.sql
Nandanrshenoy Oct 4, 2024
76481ff
Update activiti.mariadb.create.engine.sql
Nandanrshenoy Oct 7, 2024
8a5b1f2
Update activiti.mssql.create.engine.sql
Nandanrshenoy Oct 7, 2024
917ac68
Update activiti.mysql.create.engine.sql
Nandanrshenoy Oct 7, 2024
77b8b4d
Update activiti.oracle.create.engine.sql
Nandanrshenoy Oct 7, 2024
0eda65d
Update activiti.postgres.create.engine.sql
Nandanrshenoy Oct 7, 2024
a386a55
Update Execution.java
Nandanrshenoy Oct 7, 2024
8d5cd39
Update ExecutionTree.java
Nandanrshenoy Oct 7, 2024
641fa5c
Update MockProvider.java
Nandanrshenoy Oct 7, 2024
f1743d9
Update ExecutionQueryTest.java
Nandanrshenoy Oct 7, 2024
8d4d679
Update ExecutionEntityTest.java
Nandanrshenoy Oct 7, 2024
365df37
Update post.ftl
Nandanrshenoy Oct 7, 2024
4e619fa
Update ExecutionEntity.java
Nandanrshenoy Oct 7, 2024
4f53d4b
Update post.ftl
Nandanrshenoy Oct 7, 2024
3101a65
Update post.ftl
Nandanrshenoy Oct 7, 2024
e4fcf89
Update post.ftl
Nandanrshenoy Oct 7, 2024
0d5e562
Update post.ftl
Nandanrshenoy Oct 7, 2024
ab92301
Update post.ftl
Nandanrshenoy Oct 7, 2024
c8d3bcc
Update post.ftl
Nandanrshenoy Oct 7, 2024
3629d76
Update post.ftl
Nandanrshenoy Oct 7, 2024
9290158
Update ConditionRestServiceTest.java
Nandanrshenoy Oct 7, 2024
b22ff4b
Create db2_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
7029e5b
Delete engine/src/main/resources/org/camunda/bpm/engine/db/upgrade/en…
Nandanrshenoy Oct 7, 2024
3dcb2f7
Create db2_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
7b33e0b
Create h2_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
76f5fd1
Create mariadb_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
1d154a4
Create mssql_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
5dda249
Create mysql_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
39ae3a7
Create oracle_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
1ffe59f
Create postgres_engine_7.22_to_7.23.sql
Nandanrshenoy Oct 7, 2024
0442f24
Update ConditionRestServiceTest.java
Nandanrshenoy Oct 9, 2024
a4c4b8b
Update MockProvider.java
Nandanrshenoy Oct 9, 2024
21b6cda
Update ConditionRestServiceTest.java
Nandanrshenoy Oct 9, 2024
c5d6171
Update MessageRestServiceTest.java
Nandanrshenoy Oct 9, 2024
26c711c
Merge branch 'master' into feature/git-issue-4049-process-instance-pd…
Nandanrshenoy Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -40,4 +45,4 @@
desc = "The tenant id of the process instance." />

</@lib.dto>
</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"links": [],
"id": "aProcInstId",
"definitionId": "aProcDefId",
"definitionKey": "aProcDefKey",
"businessKey": "aBusinessKey",
"caseInstanceId": null,
"ended": false,
Expand All @@ -49,6 +50,7 @@
"links": [],
"id": "anotherId",
"definitionId": "aProcDefId",
"definitionKey": "aProcDefKey",
"businessKey": "aBusinessKey",
"caseInstanceId": null,
"ended": false,
Expand All @@ -71,4 +73,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"links": [],
"id": "aProcInstId",
"definitionId": "aProcDefId",
"definitionKey": "aProcDefKey",
"businessKey": "aKey",
"caseInstanceId": "aCaseInstId",
"ended": false,
Expand Down Expand Up @@ -137,4 +138,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
],
"id": "aProcInstId",
"definitionId": "aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey": "myBusinessKey",
"caseInstanceId": null,
"ended": false,
Expand Down Expand Up @@ -168,6 +169,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -196,4 +198,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -99,4 +100,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand All @@ -140,6 +141,7 @@
],
"id": "aProcInstId",
"definitionId": "aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey": "myBusinessKey",
"caseInstanceId": null,
"ended": false,
Expand Down Expand Up @@ -174,6 +176,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -202,4 +205,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -106,4 +107,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand All @@ -133,6 +134,7 @@
],
"id": "aProcInstId",
"definitionId": "aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey": "myBusinessKey",
"caseInstanceId": null,
"ended": false,
Expand Down Expand Up @@ -167,6 +169,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -195,4 +198,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
],
"id":"anId",
"definitionId":"aProcessDefinitionId",
"definitionKey":"aProcessDefinitionKey",
"businessKey":"myBusinessKey",
"caseInstanceId": null,
"tenantId":null,
Expand Down Expand Up @@ -98,4 +99,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"links": [],
"id": "anId",
"definitionId": "aProcDefId",
"definitionKey": "aProcDefKey",
"businessKey": "aKey",
"caseInstanceId": "aCaseInstanceId",
"ended": false,
Expand All @@ -53,4 +54,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"links": [],
"id": "anId",
"definitionId": "aProcessDefinitionId",
"definitionKey": "aProcessDefinitionKey",
"businessKey": "aKey",
"caseInstanceId": "aCaseInstanceId",
"ended": false,
Expand All @@ -80,4 +81,4 @@
}
}

</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"value": {
"id":"aProcessInstanceId",
"definitionId":"aProcDefId",
"definitionKey":"aProcDefKey",
"businessKey":"aKey",
"caseInstanceId":"aCaseInstanceId",
"ended":false,
Expand All @@ -45,4 +46,4 @@

}
}
</#macro>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public class ProcessInstanceDto extends LinkableDto {
private boolean ended;
private boolean suspended;
private String tenantId;
private String definitionKey;

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();
Expand All @@ -50,6 +52,10 @@ public String getDefinitionId() {
return definitionId;
}

public String getDefinitionKey() {
return definitionKey;
}

public String getBusinessKey() {
return businessKey;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,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);
Expand Down Expand Up @@ -2336,6 +2337,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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -774,9 +780,11 @@ public void setProcessDefinition(ProcessDefinitionImpl processDefinition) {
this.processDefinition = processDefinition;
if (processDefinition != null) {
this.processDefinitionId = processDefinition.getId();
this.processDefinitionKey = getProcessDefinition().getKey();
}
else {
this.processDefinitionId = null;
this.processDefinitionKey = null;
}

}
Expand Down Expand Up @@ -1447,6 +1455,7 @@ public Object getPersistentState() {
persistentState.put("suspensionState", this.suspensionState);
persistentState.put("cachedEntityState", getCachedEntityState());
persistentState.put("sequenceCounter", getSequenceCounter());
persistentState.put("processDefinitionKey", this.processDefinitionKey);
return persistentState;
}

Expand Down Expand Up @@ -1948,4 +1957,12 @@ public ProcessEngine getProcessEngine() {
public String getProcessDefinitionTenantId() {
return getProcessDefinition().getTenantId();
}

public void setProcessDefinitionKey(String processDefinitionKey) {
this.processDefinitionKey = processDefinitionKey;
}

public String getProcessDefinitionKey() {
return processDefinitionKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,9 @@ public String getProcessInstanceId() {
public String getTenantId() {
return executionEntity.getTenantId();
}

@Override
public String getProcessDefinitionKey() {
return executionEntity.getProcessDefinitionKey();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public interface Execution {
*/
String getTenantId();

/**
* The Key of the process definition.
*/
String getProcessDefinitionKey();

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public interface ProcessInstance extends Execution {
*/
String getProcessDefinitionId();

/**
* The key of the process definition of the process instance.
*/
String getProcessDefinitionKey();

/**
* The business key of this process instance.
*/
Expand Down
Loading
Loading