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

Nullpointer exception on deleting historic case instance when entityLinks is not enabled. #3745

Closed
jombie opened this issue Sep 19, 2023 · 3 comments

Comments

@jombie
Copy link
Contributor

jombie commented Sep 19, 2023

Describe the bug
Nullpointer exception on deleting historic case instance when entityLinks is not enabled.

Expected behavior
Null check or enableEntityLinks check should be done to avoid nullPointer exception.

Code

cmmnHistoryService
     .createHistoricCaseInstanceQuery()
     .caseInstanceId(caseInstanceId)
     .deleteWithRelatedData();

Additional context
Flowable version: 6.8.0
Flowable with spring boot

@jombie
Copy link
Contributor Author

jombie commented Sep 19, 2023

Fix for the same: #3746

@filiphr
Copy link
Contributor

filiphr commented Sep 19, 2023

Thanks for the fix @jombie. Apart from the fix. We would actually suggest using something like

cmmnHistoryService
     .createHistoricCaseInstanceQuery()
     .caseInstanceId(caseInstanceId)
     .deleteSequentiallyUsingBatch(10, "Test");

Instead of the deelteWithRelatedData.

If you only want to delete a single case instance you can also use cmmHistoryService.deleteHistoricCaseInstance(caseInstanceId). That deletes the right data in the right way as well

@filiphr
Copy link
Contributor

filiphr commented Jan 2, 2024

The PR was merged in 39d2fc0, but we forgot to close the issue

@filiphr filiphr closed this as completed Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants