RuntimeException after destroying ivy case
Hi Ivyteam,
We have a function to delete a list of cases base on dossierId:
SecurityManagerFactory.getSecurityManager().executeAsSystem2(() -> {
CaseQuery taskQuery = CaseQuery.create()
.where().customVarCharField4().isEqual(dossierId);
List<ICase> cases = Ivy.wf().getCaseQueryExecutor().getResults(taskQuery);
cases.forEach(ICase::destroy);
});
After the case is destroyed successfully, the application is crashed because an exception
IvyRuntimeException: Task '25' is no longer running. Maybe the task has been reseted or parked meanwhile.
ELException: ch.ivyteam.util.IvyRuntimeException: Task '25' is no longer running. Maybe the task has been reseted or parked meanwhile.
ContextAwareELException: javax.el.ELException: ch.ivyteam.util.IvyRuntimeException: Task '25' is no longer running. Maybe the task has been reseted or parked meanwhile.
Error during rendering of html dialog 'ch.axonivy.desk.individual.customer1.DataGatheringPage'
I am using Ivy 7.0.11. How can I overcome this exception?
Thanks,
Cuong Nguyen