I’m trying to prove out some concepts with the Community Edition. By and large, I would like to gain some familiarity with populating form elements with business data.
I gave myself the following project.
-
Create a simple form.
To do this, I followed this tutorial to a T and it works fine.
http://documentation.bonitasoft.com/getting-started-tutorial
-
Add a process level connector to pre-populate some of the form elements. Here’s my thinking. When a user fills in a form, they should never have to input their name, and other demographic data. I would assume I can grab some kind of session variable to get the persons details from our business database. So, in my simplistic example, I have a table in a MySQL server called users with id, firstName, lastName, email. I created an onEnter connector called getNameByEmail that simplistically runs
select lastName from users where email=‘jdoe@yahoo.com’
When I test this (in the connector creation process), it works. On the last 2 pages of the connector wizard, I select
Graphical Mode (single value) and the next screen has
[ name ] takes value of [ lastName]
In my mind, all of the linkages are there. WHen I run the process, I get a blank form.
I tried poking around the Bonita Studio Log, but couldn’t find anyhing interesting. I’m assuming I’m misunderstanding something very basic in the timing of how all of this loads and executes. Does anyone spot anything obvious? Is there a simple tutorial that will walk me through a simple ‘community-edition’ connector example?
Here’s what I think I’ve figured out from this process.
-
In the tutorial, it uses a form to initiate the process. I enhanced the tutorial by adding a pool level onEnter() connector defined to get someone’s LastName and assign it to p_lastName. If I had to guess, the form fires before the connector, and that’s why p_lastName was never set when I viewed the form. This is purely a guess. I could have also mis-configured something.
-
Because I couldn’t figure out the timing, above, I figured I’d make a 2 stage process where the employee initiates a first form, and then it is sent to a Manager Review. I added an onEnter connector on the Manager Review Task to get the next “Approval Sequence Number” from the MySQL DB . . . . and. . . low and behold, it worked. I fought with it for an embarrassingly long time, only to realize that the data from the DB was set as an integer, and the field (p_approvalSequenceNumber) was set as long. Duh. So frustrating.
I created a ton of confusion for myself by over-configuring stuff. I started toying around with a bunch of the parameters in the variables configuration and I created more problems for myself, along the way.
Now that I know the mechanics work, I can reverse engineer things to figure out what breaks things, where.
Sean McP . . . .thanks for the guidance. Just knowing I was in the ballpark made all the difference.
This all looks good, and I do it all the time so it does work.
Only thing I can think of is, is [name] actually mapped to a field on the form?
Are you also sure there is only one result returned? Are you sure ‘jdoe@yahoo.com’ is in the database?
Instead of using business data for the user why not use the inbuilt Organization for user and demographic information.
Where does your session variable come from? This would be from the Bonita organization.
regards
It’s helpful to know that the thinking is sound and that it should work. I’ve double checked all of the field names and the query.
I’m just scratching the surface on this. I’m not quite sure if and how I’ll implement BonitaSOft, but I’m hoping to prove out a concept such that we can use our existing application (with its users, groups, roles) and query whatever we have to, to fill BonitaSoft forms. As in, a user will be logged into our main application, but they’ll have an option to start a BonitaSoft form.
In my infantile understanding of this, I’d be able to use jquery to grab session info and initiate some of the needed integrations. I’m obviously trying to fit all of the pieces together, and I should probalby be looking at the RestAPIs. Right now, I’m just working through the various “getting started” guides.
Thanks for taking the time to review my question.
If you want to drop the process on a shared dropbox link where I could pick it up, I’ll be happy to give it the once through.
Just do diagram->export and send me the link via this thread.
I’ve managed to butcher it up, pretty good, but I might re-do it and I might take you up on it.
One thing to know at first, as it does seem to confuse a lot of people at the beginning is the Pool Form, this is where there are no real variables that can be used, only after the Pool Form do variables become available.
The reasoning for this is the Pool Form is essentially an Introductory screen and people can cancel out of it without starting a process. On clicking submit (OK, etc.) the process formally starts and variables etc are made available for use.
I have my pool form just as text as to what people are about to do, and then my first step (a service step) does all the pre-data manipulations.
Hope this helps,
regards
Seán
That makes perfect sense. I’ve been trying to fake things out by putting a service task (first) called “PreLoadData” and that doesn’t seem to set the variables, either. I love your “getting started” blank form idea and will put that to use, today.