-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 api enhancement #4222
Feature/git issue 4049 process instance api enhancement #4222
Conversation
…ent with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…nhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…nhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…ss Instance API Enhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…I Enhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
… Enhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…th Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…th Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…ith Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
…049 Process Instance API Enhancement with Process definition Key attribute Feat(engine) : Process Instance API Enhancement with Process definition Key attribute -Enhance the GET Process Instance based on PID /Get Process Instance List /Post Process instance list to include Process definition key in the API response -Enhance Swagger specs related to GIT Issue : 4049 Signed-off-by: Shenoy, Nandan <[email protected]>
Hi @Nandanrshenoy, Thank you for raising this. Best, |
@yanavasileva, Thanks and Regards, |
Hi @Nandanrshenoy,
We see that you have signed the CLA on 26th of March but we are not sure what is the issue. I see that the PR is created with account @Nandanrshenoy but the commits are pushed with account @Nandan-shenoy. |
@yanavasileva , Regards, |
@yanavasileva , Regards, |
I am looking into the code. I need do some research before make up my mind. (Such as: are we concerned for performance as the REST API will do additional query, do we want to expose the field to the Java API (pd id is not)) And I need to read a bit for the |
Note to myself: Details
|
@yanavasileva , Thanks and Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Nandanrshenoy,
I evaluated the proposed changes.
❌My suggestion is to add a new process definition key column to the Execution table instead of relying on an association and having additional queries to the database. So similar to processDefintionId
, persist the processDefinitionKey
as well. We already have the same in other tables (job, job def).
🔧 Please remove the GIT Issue
comments from the code.
🔧 I found the following test cases that can be extended with the new API:
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/java/org/camunda/bpm/engine/test/standalone/entity/ExecutionEntityTest.java#L110-L111
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/ExecutionQueryTest.java#L96-L101
engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Failing test (the mocks are not updated): ProcessInstanceRestServiceInteractionTest.testGetSingleInstance
with
java.lang.AssertionError:
1 expectation failed.
JSON path definitionKey doesn't match.
Expected: aKey
Actual: null
at org.camunda.bpm.engine.rest.ProcessInstanceRestServiceInteractionTest.testGetSingleInstance(ProcessInstanceRestServiceInteractionTest.java:1090)
How to run the REST API tests (after the engine and sql-script modules are built)?:
mvn clean install -Pjersey2 -f engine-rest/engine-rest/pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Changes in OpenAPI look good.
Hi @yanavasileva , Thanks and Regards, |
Hi @Nandanrshenoy, Yes, you're right, the key is somehow static. (That's why it was not already in the execution table.)
Considering above, my suggestion is still the same to introduce a new column to the execution table. Best, |
Thanks @yanavasileva for sharing your point of view. Thanks and Regards, |
My suggestion is add new column in the execution table and add new result to the |
Closing due to inactivity. The PR can be reopen at again when you get back to the topic. |
…nce API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ss Instance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…nce API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ce API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…nstance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…nstance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…tance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…stance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…Instance API Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ncement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ncement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…ncement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
… Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…I Enhancement with Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
…th Process definition Key attribute. Contribution towards process Instance API Enhancement with Process definition Key attribute. Signed-off-by: Shenoy, Nandan <[email protected]>
@yanavasileva,I have a PR that's lined up for a contribution. Could you please open this PR. Thanks and Regards, |
@Nandanrshenoy, PR is reopened. |
Thanks @yanavasileva for all your support. |
@yanavasileva ,Could you please help me with a review for this PR. Regards, |
@yanavasileva , Thanks and Regards, |
I will work on the review in the next days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nandanrshenoy, thank you for considering my feedback. You are on a good track, however, more work is required.
✍️ Please check the places where the OpenAPI needs to be adjusted. They are good indication where tests for the REST API and Java API should be added.
...e/src/main/resources/org/camunda/bpm/engine/db/create/activiti.cockroachdb.create.engine.sql
Outdated
Show resolved
Hide resolved
engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Execution.xml
Show resolved
Hide resolved
engine/src/main/resources/org/camunda/bpm/engine/db/create/activiti.db2.create.engine.sql
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExecutionEntity.java
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/cmd/StartProcessInstanceCmd.java
Show resolved
Hide resolved
...st/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.java
Show resolved
Hide resolved
...api/src/main/templates/models/org/camunda/bpm/engine/rest/dto/runtime/ProcessInstanceDto.ftl
Outdated
Show resolved
Hide resolved
Please see #4222 (comment), with the current changes the observed behaviour is expected. I suggest to set the key where the process definition id is set, that way we keep the code consistent and you won't need to look for how to cover the mentioned cases. |
I will continue the review. |
Closing as it doesn't contain the latest changes. |
Feature Description:
The Get Process Instance API does not return the Process Definition Key in the API response.
How it is currently being handled
To fetch the process definition key associated with a process instance, the end user needs to first make a call to the Get Process Instance API through which the definition ID can be retrieved and then subsequently make a call the Get Process definition API(https://docs.camunda.org/rest/camunda-bpm-platform/7.21-SNAPSHOT/{url}/process-definition/{id}) to retrieve the definition key.
Advantage of having this feature
This feature if added will avert making the additional call and the retrieval of process definition key can be supported in a single call using Get Process Instance API.
Test Screenshot
![image-2024-3-8_14-41-18](https://private-user-images.githubusercontent.com/54984261/316557628-0ceeabbd-2e91-4efe-abe5-fc1b11076b62.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTQ4MzYsIm5iZiI6MTczOTE5NDUzNiwicGF0aCI6Ii81NDk4NDI2MS8zMTY1NTc2MjgtMGNlZWFiYmQtMmU5MS00ZWZlLWFiZTUtZmMxYjExMDc2YjYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEzMzUzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2ZGU0YTE3OWViMzBlMTgwNTM2NDM0NThjN2VkNmQ2NDE4YjY2MGRhY2U4MzFkOTI5NmIyMDZkMDU5ZjNmNDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D7rCnJ-F8CKcVRurFc1MpJYNPMaPI4xRcQrcG8E2UHM)
Ticket: #4049