<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Differences of public api</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api</link><description>&lt;p&gt;Hi all&lt;/p&gt;
&lt;p&gt;There is many times that i saw similar public api from ivy then i could not distinguish between them, i believe some of my co-workers has the same feeling. In this post i need your help to make it more clear.&lt;/p&gt;
&lt;p&gt;Does they return the same result?&lt;/p&gt;
&lt;p&gt;1/ Application:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ivy.request().getApplication()
Ivy.wf().getApplication()
Ivy.wfTask().getApplication()
Ivy.wfCase().getApplication()
Ivy.session().getWorkflowContext().getApplication()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2/ ProcessModel&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ivy.wfTask().getProcessModel()
Ivy.wfCase().getProcessModel()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3/  ProcessModels&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ivy.wfCase().getApplication().getProcessModels()
Ivy.wf().getApplication().getProcessModels()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;4/ ProcessModelVersion&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ivy.request().getProcessModel().getProcessModelVersions()
Ivy.request().getProcessModel().getReleasedProcessModelVersion()
Ivy.request().getProject().getProcessModelVersion()
Ivy.wfTask().getProcessModelVersion()
Ivy.wfCase().getProcessModelVersion()
Ivy.request().getProcessModelVersion()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is some more but first i stop here :)&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2334/differences-of-public-api" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 10 Jan 2017 11:18:50 -0500</lastBuildDate><item><title>Comment by Flavio Sadeghi on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2365</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;&lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;@trungdv&lt;/a&gt;&lt;/a&gt;. I have copied you last question into a new one and edited it, as I have understood the question. Feel free to commet it if I have misunderstood it. See here: &lt;a href="http://answers.axonivy.com/questions/2364/how-is-the-handling-when-loading-business-data-in-different-pmvs"&gt;http://answers.axonivy.com/questions/2364/how-is-the-handling-when-loading-business-data-in-different-pmvs&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Tue, 10 Jan 2017 11:18:50 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2365</guid></item><item><title>Comment by trungdv on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2358</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;&lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;@Flavio Sadeghi&lt;/a&gt;&lt;/a&gt; ♦♦
Continuous with PMV, i have a case as below:&lt;/p&gt;
&lt;p&gt;In my app, we store the task in two places, when creating task, for the main data model, we store in our persistence (BusinessReposiroty) and we take out the id from there then store to Ivy Task. &lt;/p&gt;
&lt;p&gt;Q1: When user open task, we have that id then load business data from Repository. this case will work.i guess it will load with classLoader of pmv which the task belong to. is it correct?&lt;/p&gt;
&lt;p&gt;Q2: for the case we have that id then load directly data model from repo(not start from task), it could be an issue? any way to avoid it?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Tue, 10 Jan 2017 10:23:57 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2358</guid></item><item><title>Comment by Flavio Sadeghi on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2357</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;&lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;@trungdv&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The deployment wizard decides on the basis of the project version (IvyProject -&amp;gt; Definitions -&amp;gt; Deployment -&amp;gt; Project Version) if a new PMV has to be created or an already existing PMV can be used. And yes, there were some fixes since 6.3...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Mon, 09 Jan 2017 14:05:00 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2357</guid></item><item><title>Comment by trungdv on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2353</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;&lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;@Flavio Sadeghi&lt;/a&gt;&lt;/a&gt; ♦♦&lt;/p&gt;
&lt;p&gt;thanks a lot.&lt;/p&gt;
&lt;p&gt;I just realize that somehow is a problem of deployment wizard tool, when i use it to deploy, it always deploy latest version on PMV1 (even i select PMV2 as the target). that's why i see the new logic on old cases.&lt;/p&gt;
&lt;p&gt;So when i try with Deploy button on each PMV, it work as you said.
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/Untitled_YeaDeJa.png"&gt;
I'm using version 6.3.0, don't know whether this is an issue or not. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Fri, 06 Jan 2017 02:31:46 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2353</guid></item><item><title>Comment by Flavio Sadeghi on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2351</link><description>&lt;p&gt;Hello &lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;&lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;@trungdv&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How do you start a case/task of PMV1 from PMV2? I would argue that the the case/task is started in PMV1 and that classes of PMV2 are not visible in PMV1, since this would lead to conflicts, because classes exist in both PMVs, at least the class of the process itself... (except you have some application-wide caching , which is not allowed in such use cases)&lt;/p&gt;
&lt;p&gt;If it should be possible, I would classify this as an bug. Of course, I would be happy for the test projecte to verify the behaviour.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Thu, 05 Jan 2017 09:51:22 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2351</guid></item><item><title>Comment by trungdv on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2350</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;&lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;@Flavio Sadeghi&lt;/a&gt;&lt;/a&gt; ♦♦&lt;/p&gt;
&lt;p&gt;Yes, i have another question, as you said "Case/Task lives always in the PMV the Case was started in". so for example i have a project A then i deploy it to PMV 1, i create some cases/tasks on this version. &lt;/p&gt;
&lt;p&gt;Then i change implementation of Project A (i keep all task elements, just implement some new java class, new api, new logic). Now i deploy project A to PMV 2 (new version) and make it Active and Released.&lt;/p&gt;
&lt;p&gt;Question: What happen if i start cases/task of PMV1 from released PMV (version 2)? which classes will be loaded? &lt;/p&gt;
&lt;p&gt;I have some small test and i saw the old task will run on released PMV (PMV2), is it correct?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Thu, 05 Jan 2017 05:50:41 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2350</guid></item><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api/2345</link><description>&lt;p&gt;First we have to separate between &lt;code&gt;configuration&lt;/code&gt; and &lt;code&gt;runtime&lt;/code&gt; data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Configuration&lt;/code&gt; data are in the system database stored data, like Applications, Cases, Tasks, Users, etc. &lt;/li&gt;
&lt;li&gt;&lt;code&gt;Runtime&lt;/code&gt; data are not persistent and exists only at runtime, like the requests or sessions. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;
All API calls on the &lt;code&gt;Ivy-Bean&lt;/code&gt; returns either configuration or runtime data related to the current execution context. E.g. the current executing request or the task of the current execution process.&lt;/p&gt;
&lt;p&gt;The following APIs return runtime objects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/environment/Ivy.html#request--"&gt;Ivy.request()&lt;/a&gt; Returns the current execution &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/request/IProcessModelVersionRequest.html"&gt;IProcessModelVersionRequest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/environment/Ivy.html#session--"&gt;Ivy.session()&lt;/a&gt; Returns the related &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/IWorkflowSession.html"&gt;IWorkflowSession&lt;/a&gt; to the current request&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following APIs return configuration objects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/environment/Ivy.html#wf--"&gt;Ivy.wf()&lt;/a&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/IWorkflowContext.html"&gt;IWorkflowContext&lt;/a&gt; of the current execution Application.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/environment/Ivy.html#wfTask--"&gt;Ivy.wfTask()&lt;/a&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html"&gt;ITask&lt;/a&gt; of the current process&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/environment/Ivy.html#wfCase--"&gt;Ivy.wfCase()&lt;/a&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html"&gt;ICase&lt;/a&gt; of the current process&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Further calls on a configuration object returns always further configuration objects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html#getCase--"&gt;ITask.getCase()&lt;/a&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html"&gt;ICase&lt;/a&gt; the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html"&gt;ITask&lt;/a&gt; belongs to&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html#getProcessModelVersion--"&gt;ICase.getProcessModelVersion()&lt;/a&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/IProcessModelVersion.html"&gt;IProcessModelVersion&lt;/a&gt; the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html"&gt;ICase&lt;/a&gt; belongs to&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html#getProcessModelVersion--"&gt;ITask.getProcessModelVersion()&lt;/a&gt; Is equivalent to &lt;code&gt;ITask.getCase().getProcessModelVersion()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html#getProcessModel--"&gt;ITask.getProcessModel()&lt;/a&gt; is quivalent to &lt;code&gt;ITask.getCase().getProcessModelVersion().getProcessModel()&lt;/code&gt;. Basically each &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ITask.html"&gt;ITask&lt;/a&gt; belongs to a &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html"&gt;ICase&lt;/a&gt;, &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/ICase.html"&gt;ICase&lt;/a&gt; belongs to a  &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/IProcessModelVersion.html"&gt;IProcessModelVersion&lt;/a&gt;, A PMV belongs to a &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/IProcessModel.html"&gt;IProcessModel&lt;/a&gt; and PM belongs to a &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/IApplication.html"&gt;IApplication&lt;/a&gt;. So the following two API calls are equicalent&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ivy.wfCase().getApplication().getProcessModels()&lt;/code&gt; returns all Process Models of the Application the current Case belongs to. As well as the call &lt;code&gt;Ivy.wfTask().getApplication().getProcessModels()&lt;/code&gt;. Because a task and a case belongs to the same pmv, pm and application.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IProcessModelVersionRequest.getProcessModelVersion()&lt;/code&gt; Returns the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/IProcessModelVersion.html"&gt;IProcessModelVersion&lt;/a&gt; the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/request/IProcessModelVersionRequest.html"&gt;IProcessModelVersionRequest&lt;/a&gt; belongs to&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ivy.request().getProcessModel().getReleasedProcessModelVersion()&lt;/code&gt;: The current &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/request/IProcessModelVersionRequest.html"&gt;IProcessModelVersionRequest&lt;/a&gt;belongs to a Process Model, this process Model has one single ‘released’ Process Model Version. This is returned here and this has not to be the same as &lt;code&gt;ivy.request.getProcessModelVersion()&lt;/code&gt;, because a Case/Task lives always in the PMV the Case was started in.
Etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope this information will help. Don't hesitate to ask further question as comment. I will update the answer.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Fri, 30 Dec 2016 12:55:25 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api/2345</guid></item><item><title>Comment by trungdv on trungdv's question</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2344</link><description>&lt;p&gt;Yes, thanks.
Actually i can create test and check for myself but can't do fo everyone. They need a clear documentation. This post here for them. They dont need to ask around everytime they use it. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Fri, 30 Dec 2016 10:13:45 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2344</guid></item><item><title>Comment by Flavio Sadeghi on trungdv's question</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2342</link><description>&lt;p&gt;Yes and no. If you do not understand it, I think we have to update the java-doc...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Thu, 29 Dec 2016 14:34:23 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2342</guid></item><item><title>Comment by Genzer Hawker on trungdv's question</title><link>https://answers.axonivy.com/questions/2334/differences-of-public-api#2338</link><description>&lt;p&gt;We can write some small test processes to check it right? :D&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Genzer Hawker</dc:creator><pubDate>Thu, 29 Dec 2016 12:09:41 -0500</pubDate><guid>https://answers.axonivy.com/questions/2334/differences-of-public-api#2338</guid></item></channel></rss>