getting mssql datas to a pool default form

1
0
-1

Hello,

We have a problem fetching datas from a database and injecting it in the default form of a pool :

A jdbc connector has been configured on the pool level, and datas are fetched correctly via a script injecting datas into a java.util.Map declared at the pool level. It's configured to be run ON_ENTER.

On the default form, we can't configure a select field to accept this Map. We can't configure a new connector on this select field with the ad-hoc button on panel general > Data > available values If we use a generated form, bonita wizard propose the java.util.Map in the binded datas list, but use a list field to represent it. Worse, the list field is empty at runtime, there is no error in log, and server doesn't seems to use the jdbc connector at this time (according to the logs) : only after form submission.

The workaround is to move (in fact rebuild) the form on the first task, and configure the pool pageflow to skip, completly bypassing the default form. That way, the form display correct values and the jdbc connector run before the form is displayed.

But it's a workaround for a bug, and there is a drawback : user arrive on a empty page saying them "The case 5 has been started. A task is now available" And they have to click on the link to fill their form.

Is this a bug referenced somwhere ?

My version of bonita soft : 6.3.8 with Java version 7, database server sql server 2008R2, on Windows 7

2 answers

1
0
-1

Hi David,

I understand your problem only too well, but I've used it to my advantage...

You will always get the pool screen (or message that says task is ready even if skipped). This will always be present UNLESS you start the process programmatically. Not possible in many cases. If you start a process programmatically then the pool screen does not appear.

The only thing I can suggest is to use the process pool screen as an introduction page to the process and add a confirmation page that auto routes to your next step on the user confirming they want to do this process by way of the submit button...

This is different from B5 when everything was synchronous, now it is Async, we have it this way though Bonita I believe are looking at changing this behaviour.

DO have a look at the Automatic-Confirmation-Template available here , I use it everywhere!! It's a life saver.

Note though: a bug has been raised and will be fixed soon (possibly 6.4.2) such that when you duplicate a process you have to reset all the confirmation pages because the links are broken.

Hope this helps, regards Seán

1
0
-1

If you want to populate your select field with a map, you can add a script in general > Data > available values :

return new ArrayList<String>(yourMap.keySet());

or

return new ArrayList<String>(yourMap.values());

This is not recommanded to have a connector and a form on the same task. It is preferable to have the connector on a first task and then the form of the next task.

Comments

Submitted by david.doumeche.itk on Fri, 01/23/2015 - 10:21

Thanks for your quick answer, but we have no problem fetching and displaying the datas.

The question was more on the usability of default form in that kind of situation since the jdbc connector is called after form submission instead at task start, despise being set on event="ON_ENTER" in .proc and being configured at the pool level (which is a bug for me).

In that case, I understand the default form can't be used because of those limitations, but is there a way to have a smooth transition from pool start to the first step ?

Submitted by marcos.pinto on Mon, 01/26/2015 - 16:04

Hello David, You have a problem ou misunderstanding about on wich time te connector runs, the connector on the pool has two moments to execute. The first one (ON_ENTER) runs on the same moment that the engine renders the pool form. Unfortunately it's a limitation over the assyncronous (this is my opinion) engine. The only way to solve this is to use the option of Transient Data (Select pool, Application > Page Flow > Transient Data) but remember that the transient data exists only when the form is alive, when this is closed, all data is lost, so don't forget to save it on database or use a destination variable that is a process variable. About the type of the variable, on a select list widget you can have the two types of Collection, the List or a Map, with a List, the value that goes to a destination variable is the same you can see on the list rendered, with a Map, because it's pair of values nature, you can put a value to be rendered on the widget list and a back value that indeed goes to the destination variable, E.g.: with this Map {(1, 'One'), (2, 'Two'), (3, 'Three')} the String values goes to the list rendered and the number values goes to the destination variable. Take a look at the select input on HTML and you see what I'm saying.

Hope this gives you some clarity about this points that are not explained clearly on Bonita documentation.

Marcos Vinícius Pinto MXM Sistemas Brasil

Submitted by david.doumeche.itk on Wed, 02/11/2015 - 16:39

Hello marcos,

and thanks for your answer. I tested your advise and discovered the transient datas, which I didn't know before.

Unfortunatly, it doesn't solve my problem because when configured ONENTER, the Jdbc connector is fired after the first form has been submitted. Transient values or not. This is an incoherent behaviour with the ONFINISH event which is triggered at the End of the task in the pool.

Once again the problem is more about ordering than on the jdbc connector itself.

Let me explain in a picture and a bos

test onfinish onenter

Submitted by yannick.lombardi on Wed, 02/11/2015 - 17:12

Hi david.

I think the "default form" is display BEFORE the process start. So you can't have a connector that execute before the process start. That's why you can't fill the "default form" with data from your database.

Why do you want to fill the default form with data ? Would it not be better to skip the default form and add a task before your "2. User Step" ?

Submitted by marcos.pinto on Wed, 02/11/2015 - 17:21

Hello David,

Did you used the connector to initialize the transient data ? They are configured at the same place that you define transient data. If you did, it´s strange that doesn't fullfil your transient datas... After all, the behaviour you consider incoherent, aren't because you are thinking about the page form in the pool, it came after the process, so when you open this form, the process does not started yet. It will start when this page is finished. Just like yannicklombardi answered above. You need to define the exactly why you need this page before the process with data.

Submitted by david.doumeche.itk on Wed, 02/11/2015 - 17:21

Hello Yannick,

I need to display a list of geographic site to know where a new recrutement will take place, and store the selected value in the following step on process. I actually managed to bypass that problem but for me it's a bug, and I would like it to be taken in consideration. And eventually fixed.

And since we are considering this tool for a large intranet projet, I would like to know how such things are considered by the bonita community

Regards.

Submitted by yannick.lombardi on Wed, 02/11/2015 - 17:25

You can initialize transient data with a connector only in the subscription version. I don't think this is possible in the community version otherwise I would like to know how to do.

Submitted by david.doumeche.itk on Wed, 02/11/2015 - 17:36

Where can i find a "definitive" list of difference between the differents editions ?

Submitted by yannick.lombardi on Wed, 02/11/2015 - 17:42

Here : http://www.bonitasoft.com/how-we-do-it/compare-editions

For each functionnality you can also find information about the version in the documentation. For example, "Use a connector to set the value of a transient variable" : http://documentation.bonitasoft.com/use-connector-set-value-transient-va...

You can see that it is only in TeamWork/Efficiency/Performance version, not in Community version.

Submitted by marcos.pinto on Wed, 02/11/2015 - 17:58

You're correct yannicklombardi! Sorry David, I didn't asked you if you are using the community or subscription version!

Submitted by david.doumeche.itk on Wed, 02/11/2015 - 18:13

Hello marcos.pinto,

you wrote" After all, the behaviour you consider incoherent, aren't because you are thinking about the page form in the pool, it came after the process, so when you open this form, the process does not started yet. It will start when this page is finished. Just like yannicklombardi answered above. You need to define the exactly why you need this page before the process with data."

After studying the logs carefully, I got what you mean : default form are in fact displayed "ahead of process", the process is started by org.bonitasoft.engine.api.impl.ProcessStarter when the default form is filled or skipped.

This is a bit troubling for a newcommer.

Submitted by marcos.pinto on Wed, 02/11/2015 - 18:27

For sure David, you get into the core! This really IS troubling for a beginner in Bonita. I saw once in the documentation the information about it, and the recommendation from Bonitasoft is that the process page form should be used for display a summary or introduction about the process to come (plain text) or to request some information from the user to be use in the start of the process.

Cheers, Marcos Vinícius Pinto MXM Sistemas, Brasil.

Notifications