How to access a connector / Data Base from the initial/instantiation Form/Page?
Hi every body, any help will be appreciated.
I try to access using the API Rest, but the method need the activyty/task id or the instance flow id.
This is because the connector stores its result in a proces/local/Busines data model or Variables,
but in the initial form I don’t have an
instance of the flow/task/activity and I can’t access to the variable that stores the value.
I need to use the connector to access data base and to the Ldap
to get some values to show in the initial form before instantiating the process.
Is there any way to call a Groovy Script from initial Form?, if there is,
I can access from that script to the data base, and save this value into a form variable, to show it in the form I think.
P.S.: I use Bonita 7.2
thanks!
I think it may be posible to do it accessing to the business variables.
-Business variables:
Life cycle: independent of process instance. Fully control by developer by process design (default values, operations).
Scope: available to all process definition/instance on a given server (on a given tenant for subscription edition).
Data access: you can access the data using API but also directly query the database.
Data storage: data are stored in a structured way in database. Complex object are breakdown into several columns/tables so data can easily (and efficiently) be read directly from database.
But I don’t know how to do it. May be I can do it with the API rest, but I don’t see it in the official documentation.
If I initialize a business variable with data from the data base or from the Ldap, and I show it in the initial form, I think It will works but I don’t know how.
Someone knows it?
It’s not possible to access ANY data from process variables, databases etc. before the instantiation form, I know this for a fact. Been working on it for a while.
To fully understand the sequence of events have a look at http://documentation.bonitasoft.com/execution-sequence-states-and-transactions-0
That doesn’t mean it can’t be done, and we’ve done it quite successfully. Here is what you have to do:
- Create a Custom Widget (which accepts a series of parameters(your design, your parameters))
- The custom widget makes an AJAX call to a web-service that returns the necessary data you want to display on the form.
- The web-service can use the parameters to access databases etc. and determine what data to pass back to the Custom Widget.
regards
Seán
PS: If this reply answers your question, please mark as resolved.
I’ve seen this in the Getting started tutorial:
myPendingRequests:…/API/bdm/businessData/com.company.model.TravelRequest?q=findByUserIdAndStatus&p=0&c=10&f=userId={{session.user_id}}&f=status=pending
This calls a business data variable, I think I can use this but It doesn’t return anything.
I’m using this:
…/API/bdm/businessData/com.company.model.StringLdap?q=findByCadena&p=0&c=10&f=cadena=David
Thanks Seán, I have a doubt, the web-service that you mentions, is an external web service implemented by my?, it has nothing to do with Bonita, isn’t it?
I’m going to try it.
Correct, it’s your web-service, that you have to write.
we have one that just does everything for us.
If you need a hand, I’ll be busy the next few days moving to NZ.
regards
Ok, thank you very much, I think that this kind of personalized widget could be done in the comunyty version. I don’t need to pay for the subscription version.
Thanks
This only accesses valid existing BDM’s make sure it exists etc. it should work,
but databases etc. see my other answer.
regards