Questions Tagged With apihttps://answers.axonivy.com/tags/api/?type=rss&user=Emmanuelquestions tagged <span class="tag">api</span>enWed, 11 Mar 2015 02:54:29 -0400Is it possible to find the ICase that has lead to another ICase creation?https://answers.axonivy.com/questions/1220/is-it-possible-to-find-the-icase-that-has-lead-to-another-icase-creation<p>Hi everybody!</p> <p>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: <a href="http://answers.axonivy.com/questions/1193/listen-to-process-case-start-and-task-creation-start">listen-to-process-case-start-and-task-creation-start</a></p> <p>A very convenient way would be something like:</p> <pre><code>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 </code></pre> <p>Thanks a lot in advance! Cheers Emmanuel</p>EmmanuelWed, 11 Mar 2015 02:54:29 -0400https://answers.axonivy.com/questions/1220/is-it-possible-to-find-the-icase-that-has-lead-to-another-icase-creationapiHow can I find out if a user is logged in?https://answers.axonivy.com/questions/445/how-can-i-find-out-if-a-user-is-logged-in<p>I need to know if a particular user has an active session in an Ivy application, or in other words whether he is currently loggedin.</p> <p>I can get a particular IUser with <code>Ivy.session.getWorkflowContext().getSecurityContext().findUser("username")</code> and I can get all the sessions with <code>ivy.session.getWorkflowContext().getSecurityContext().getSessions()</code>.</p> <p>But I cannot find the way to see if the user is part of one of these sessions?</p>EmmanuelThu, 08 Mar 2012 08:40:26 -0500https://answers.axonivy.com/questions/445/how-can-i-find-out-if-a-user-is-logged-inapi