1
1

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) {
return;
}
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

Emmanuel
(suspended)
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.

link

answered 11.03.2015 at 20:37

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

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:

×37

Asked: 11.03.2015 at 02:54

Seen: 2,161 times

Last updated: 11.03.2015 at 20:37