There written in the public document:

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.

I just found out that you can make an ICase persisted without any TaskSwitch element in the process by setting an additionalProperty.

As soon as the line of code is evaluated:

ivy.case.setAdditionalProperty("anything-will-do", "some-value");

The ICase will be persisted immediately.

Is this a non-public behaviour or a bug in the API?

P.S: there is a demo project to demonstrate this behaviour at https://www.mediafire.com/?hxi3z0v27dhjxh4

asked 29.04.2016 at 05:40

Genzer%20Hawker's gravatar image

Genzer Hawker
(suspended)
accept rate: 66%

edited 29.04.2016 at 05:41


Hi

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.

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.

link

answered 29.04.2016 at 08:10

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Hi Reto Weiss, I don't actually 100% agree with the answer though. By calling some optional method like setAdditonalProperty can make a side-effect such that the ICase is persisted into database is a big surprise. Saying the behavior is by design is like saying that the API has been driven by the database schema and we have no other way to implement it. I think this fact should also be in the public document also.

(05.05.2016 at 04:29) Genzer Hawker Genzer%20Hawker's gravatar image

Hi Genzer Hawker I've improved the API documentation as suggested. Thanks for the feedback

(17.05.2016 at 10:29) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

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:

×32
×18
×11
×3

Asked: 29.04.2016 at 05:40

Seen: 3,224 times

Last updated: 17.05.2016 at 10:29