<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Why does Axon.ivy persist an ICase when `setAdditionalProperty` is invoked even if there is no TaskSwitch element?</title><link>https://answers.axonivy.com/questions/1755/why-does-axon-ivy-persist-an-icase-when-setadditionalproperty-is-invoked-even-if-there-is-no-taskswitch-element</link><description>&lt;p&gt;There written in the &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.concepts.html#ivy-wf-states"&gt;public document&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Normally, a case is started non persistent. This means it is stored in memory only. As soon as the process hits a task switch the case and its tasks will be made persistent by storing them to the system database.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I just found out that you can make an ICase persisted without any TaskSwitch element in the process by setting an &lt;code&gt;additionalProperty&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As soon as the line of code is evaluated:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ivy.case.setAdditionalProperty("anything-will-do", "some-value");
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;ICase&lt;/code&gt; will be persisted &lt;em&gt;immediately&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Is this a non-public behaviour or a bug in the API?&lt;/p&gt;
&lt;p&gt;P.S: there is a demo project to demonstrate this behaviour at &lt;a href="https://www.mediafire.com/?hxi3z0v27dhjxh4"&gt;https://www.mediafire.com/?hxi3z0v27dhjxh4&lt;/a&gt;&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1755/why-does-axon-ivy-persist-an-icase-when-setadditionalproperty-is-invoked-even-if-there-is-no-taskswitch-element" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 29 Apr 2016 08:10:29 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1755/why-does-axon-ivy-persist-an-icase-when-setadditionalproperty-is-invoked-even-if-there-is-no-taskswitch-element/1757</link><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Your right. This is by design. If you set an additional property or add a note to case then the additonal property or the note is stored in the system database. Because the table for additional properties and notes have a foreign key to the case also the case needs to be stored in the system database. Otherwise the additonal property or note cannot be stored and a SQL constraint Exception would be rised. &lt;/p&gt;
&lt;p&gt;Note, that this does not manipulate the state of the case or task. Both are still in state CREATED and not RUNNING or RESUMED after storing to the system database.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Fri, 29 Apr 2016 08:10:29 -0400</pubDate><guid>https://answers.axonivy.com/questions/1755/why-does-axon-ivy-persist-an-icase-when-setadditionalproperty-is-invoked-even-if-there-is-no-taskswitch-element/1757</guid></item></channel></rss>