Process Data, is it saved?

1
0
-1

Hey folks,

I have variables/data used on my processes. I use jboss and h2 database at this time.

When a user completes a form and clicks save, does the data/form data actually save in the bonita database? Or do I have to build a database and save the form using a connector to my database?

Thanks, Jim

3 answers

1
+1
-1
This one is the BEST answer!

Hello, yes, process data is automatically saved by Bonita BPM Engine, unless you define it as transient. You can find more information in the documentation here (check section Transient data). Hope this helps, Haris

1
0
-1

Hello Haris,

That makes perfect sense. Just to be sure, could you talk me through:

"Once the process is executed, process data lifecycle is finished, as well. This is why we recommend to externalise the business data"

So, when the process is running, form data is stored in the H2 database. At the end of the process, the data is lost/unavailable. So, if after each process we need to access that data through another process/application outside of Bonita - it needs to have been stored by a connector in to our external database(s)?

Comments

Submitted by haris.subasic on Mon, 11/17/2014 - 15:53

At the end of the process, the data is archived internally. It is not lost. It will be available through our API, that enables you to access the archived data. If you want to handle it more easily, you can use an external database and access to it using SQL. In the latter case, you will store and read data using connectors (in Community version) or BDM (in Subscription version).

Submitted by jimmyg on Mon, 11/17/2014 - 16:05

So, if we are to access from the archive. we would need to make some sort of J2E server/service to use your API and retrieve the data? We would use calls to the API rather than some sql queries to the archive directly?

Submitted by antoine.mottier on Tue, 11/18/2014 - 13:27

Exactly, if data are declared in a process or on a step of a process they are stored associated with the process. When the process is done, process instance is archived and so the associated data.

You can access process data using API:

1
0
-1

Hi Haris,

Thank you for the response.

So, any data I create in a process, providing its not transient - is stored in my H2 database? If I change to SQL Server, it will store in that database?

How do I access the data? For example, I have a process that asks for a name then ends. I run this 100 times. So, really, I now have 100 names in the H2 databases for each instance of this process.

How do I build another process to list those names? Any examples or pointers?

I see the page says it is reccomended to store business data in a seperate database. Does this mean that at the end of a process I should make a connector to save the data in my sql database, for example?

Many thanks, Jim

Comments

Submitted by haris.subasic on Mon, 11/17/2014 - 15:40

Hi, Yes, all non transient data is saved to the internal database. Depending of what you configured, it would be H2, SQL Server etc. You can access the data throughout your process execution by accesing the process data (variable) that contains it. Once the process is executed, process data lifecycle is finished, as well. This is why we recommend to externalise the business data in an external database and to detach it from the process lifecycle. Your business data would remain accesible after a process instance is finished (to other process instances or even different applications). Yes, you can use connectors to save (and update or delete) the data to your external business database. Note that in Subscription edition, you have a BDM feature that helps you with that.

Submitted by Sean McP on Mon, 11/17/2014 - 16:14

Hi Jim,

You have it right. And this is where some get a little confused, what is Process data if it is not Business Data?

This is my interpretation...

Basically what happens is the data is kept with the process as "evidence" that the process was run and run in a particular way.

Process data should really be defined as "those entities (and their values) that enable or change the flow within a process"

imagine a branch, is SalesValue > 1,000 then do this, otherwise do this. SalesValue is Process data as it changes the flow. It can be used as evidence in a later trial if necessary.

Whereas Business data "are those entities that may have no value to the process but value to the business".

In the above example SalesValue of course has business value so it is both Business data and Process data...

Whereas Seán (a persons name) is probably of no value to the process, who puts a condition - if Seán comes along give him an Aston Martin? This is just business data and has no relevance to the outcome of the process (unless someone wants to give me an Aston Martin :)

Business Data shouldn't really be saved with the process unless it is used to alter the flow of the process, this is just duplication of data, however it is what it is.

That being said, in your example there will be 100 archived processes and you could write a routine to read all 100 archived processes and use the data that way - but don't do it, use the database as you have already guessed, and rather than save the data at the end of the process, save as you go along, I find it much better.

I think there is one type of Data that is missing from Bonita which is POOL Transient Data,

As you will have read,

process data that stays with the Process in its entire life, including after it is archived, and transient data that is only available to the step in question.

My view is POOL Transient Data, means that the data is Available to the pool during this execution and this execution only and is never saved once the process finishes.

This would mitigate my circumstance where I've had to add one step to a process to clear all process data for security reasons. As **Haris **said

*Your business data would remain accesible after a process instance is finished (to other process instances or even different applications). - See more at: http://community.bonitasoft.com/answers/process-data-it-saved#sthash.PWp... *

as far as I'm concerned - a potential security hole...

I think I'll add this as a Required Feature Request.

Here is a sample of what you should be doing

var1 transient var2 pool data show screen, get var1, var2, click OK -> ON EXIT connector to save to database must be ON THE SAME STEP

if var 2>0 then var3 transient show screen, get var3 click OK -> ON EXIT connector to save to database must be ON THE SAME STEP

else var4 transient show screen, get var4 click OK -> ON EXIT connector to save to database must be ON THE SAME STEP

The only pool data that is saved is var2.

Hope that helps, regards Seán

Submitted by jimmyg on Mon, 11/17/2014 - 16:20

Dear Sean,

This makes perfect sense. Thank you. I think the feature request would also be quite sensible.

Just to clarify though, should we need to access the 100 names that were archived, would our options be both:

1) A bonita process to use bonita to find the processes and names. 2) A J2E application to use the api to make a call and get the names.

Thanks Sean and Haris, Jim

Submitted by Sean McP on Mon, 11/17/2014 - 16:39

Both would work, but I would seriously save the data outside of the process...in a separate database...

regards Seán

Submitted by jimmyg on Mon, 11/17/2014 - 16:42

The external database is what I am most familiar with and how I of course would want to go forward, but that decision is out of my hands :(

All I can do is give the options to management and let them have at it :)

Thank you both very much for the help. Appreciated, Jim

Submitted by Sean McP on Wed, 11/19/2014 - 08:58

Hi Jim,

here is a link to my "idea" (feature request) for the third type of data, Pool Transient. If you want to add anything, give it a vote etc.

regards Seán

http://community.bonitasoft.com/ideas/add-third-category-variable-pool-transient

Notifications