Hi everybody!

I have a process which triggers another process start through a trigger step. The first process has a related ICase (ivy.case) and the 2d started process belongs to another ICase. We could consider in such a situation that the first ICase is the "ancestor" of the second one. Is there a possibility to get a reference to the "ancestor" ICase from the second one? Especially in a WorkflowEvent Listener like the one stated in this question: listen-to-process-case-start-and-task-creation-start

A very convenient way would be something like:

IWorkflowEvent createEvent = wfManager.findWorkflowEvent(event.getId());
if (createEvent.getEventKind() != WorkflowEventKind.EVENT_CREATE_CASE) {
ICase newCase = createEvent.getCase();
newCase.getAncestorICase() // null if no ancestor, the ICase from which this newCase has been triggered

Thanks a lot in advance! Cheers Emmanuel

asked 11.03.2015 at 02:54

Emmanuel's gravatar image

accept rate: 66%

You can use the following code to get ancestor case from a case:

ICase ancestorCase = newCase.getCreatorTask().getCase();

The method getCreatorTask() returns the task in which the trigger step was called. The case of this task is the ancestor case.


answered 11.03.2015 at 20:37

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
accept rate: 74%

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 11.03.2015 at 02:54

Seen: 1,379 times

Last updated: 11.03.2015 at 20:37