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

asked 10.06 at 03:25

nvcuong01's gravatar image

nvcuong01
113
accept rate: 0%

edited 10.06 at 03:28

sounds like your script just killed the task/case which owns the dialog(script activity) which runs the deletion script. So I'd start to fix this issue by filtering the current case.

(11.06 at 03:43) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Thank @Reguel Wermelinger for your response. Could you clarify how to "filtering the current case"?

(11.06 at 04:06) nvcuong01 nvcuong01's gravatar image

in plain java: ICase current = Ivy.wfCase();

therefore...

CaseQuery taskQuery = CaseQuery.create()
.where().customVarCharField4().isEqual(dossierId)
.and().caseId().isNotEqual(Ivy.wfCase().getId());
(11.06 at 04:36) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

The issue was solved. Thank @Reguel Wermelinger for your help!

(11.06 at 05:21) nvcuong01 nvcuong01's gravatar image

the script just killed the task/case which owns the dialog(script activity) which runs the deletion script. So I'd start to fix this issue by filtering the current case:

CaseQuery taskQuery = CaseQuery.create()
.where().customVarCharField4().isEqual(dossierId)
.and().caseId().isNotEqual(Ivy.wfCase().getId());
link

answered 11.06 at 05:22

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.5k21851
accept rate: 69%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×18

Asked: 10.06 at 03:25

Seen: 173 times

Last updated: 11.06 at 05:22