save data in mysql table

Hi,

Is it possible to save data from a form into external database (MySql) in Bonita BPM 6.4 Community version?

I tried to create connection and entered insert script, but it is giving error:

“Input parameter ‘script’ us an expression containing unreachable reference”

Regards,
Manoj

Thanks for reply,

I wanted to save form data in registration form which contains three fields

When I test its giving same error but data is saved in mysql table when I run the process and submit form.

I used groovy script to save data and it worked:

def insert= “”
insert = “INSERT INTO data (name, email,partner_name)” + " VALUES(‘“+name+”’, ‘“+email+”’,‘“+partner+”’)"

I also want to know whether it is possible to use java code (not groovy), as I have not knowledge of groovy, or its mandatory to use groovy in Bonita

Thanks,
Manoj

Hi,

Is it possible for you to share your process and also the full log file content? It will really help us to find what is the issue in the connector configuration.

Also are you willing to store a form widget content or a step or process data? If the information is stored in step or process data you can include the variable name surrounded by ${ and } in your SQL query. Note that subscription edition of Bonita allow to use directly process data in connectors when submitting forms (and so avoid duplication of information).

What you might want to do is to create a new connector (see http://documentation.bonitasoft.com/creating-connector) that have your three data as input and take care of database connection, SQL query construction and execution. Bonita connectors are Java classes. You can check the Bonita standard database connectors source code here: https://github.com/bonitasoft/bonita-connector-database

Also note that it’s possible to write groovy script using Java syntax.