how to insert data using bonita ui into a mysql work bench?

would some one please suggest and explain me how to insert data to mysql_workbench
using bonita bpm 7.2 (ui) or form please i am trying to do this from last three day but still not able to do it…

Here we go then, no graphics, and I’m using PostgreSQL, so you have to make it work with MySQL.

Create your database make it simple, use this code:

– Database: “db1”
DROP DATABASE if exists “db1”;
CREATE DATABASE “db1”
WITH OWNER = bonita
ENCODING = ‘UTF8’
TABLESPACE = pg_default
LC_COLLATE = ‘English_Ireland.1252’
LC_CTYPE = ‘English_Ireland.1252’
CONNECTION LIMIT = -1;

Create your table, again making it simple, use this code:

– Table: tb1
DROP TABLE if exists tb1;
CREATE TABLE tb1
(
“userName” text
)
WITH ( OIDS=FALSE );
ALTER TABLE tb1 OWNER TO bonita;

Get the insert query (use your method to do this, I used pgadmin III), and save for later:

INSERT INTO tb1(“userName”) VALUES (?);

  1. Open Bonita Studio
  2. Create New Diagram and rename testToPostgreSQL
  3. Development->Business Data Model->Manage
  4. Add (List of Business Objects)->change the default name
  5. Add (Attributes) userName as STRING->Finish
  6. Click the POOL->Data tab->Add (Business Variables)->give it a name->make sure is the correct Business Data Model->Finish
  7. Click on Execution Tab->Contract->Add from Data->Finish->OK
  8. On the right hand of the screen click the UI button next to the ?
  9. UI will open and a newForm will be generated->Change the name of the form and click Save->Close the UI
  10. Click on Step 1->Right Click and change to a Service Task
  11. Click on Execution Tab->Connectors In->Add->Database (Categories)->select you DB and your Connector definition->Next->give it a name (insertToDB)->Next->Next
  12. Fill in URL, username and Password for accessing the Database, in this example we are using bonita->Next
  13. Switch Editor->Yes
  14. Click the Pencil icon
  15. Click Script->give it a name->and using the Insert query we saved before add to the Script window and make it look something like this:

return “INSERT INTO tb1("userName") VALUES ('” + + “');”;

  1. Place the cursor BETWEEN the two + + → click on Select a variable and select the Business data Object->type . (dot)->select getUserName()

  2. The whole query should now look like:

return “INSERT INTO tb1("userName") VALUES ('” + dataFromForm.getUserName() + “');”;

  1. Click OK->Next->Next->Click the X button to delete the Output Operation (Inserts do not do returns)->Finish

  2. Click Run

  3. The Form will open in the browser

  4. Add a User Name

  5. Click Submit

  6. Browser returns to Bonita main page

  7. Look at your database, the record is now there…well it works for me,

Hope this helps,

regards
Seán

PS: If this reply answers your question, please mark as resolved.

Asking the same question more than once will NOT get you a quicker answer. The community have paid jobs to do, we are not always available to do our good work…we do not get paid for this and we also do not work for Bonitasoft.

I will try but I promise nothing as to today, tomorrow, or the following day.

regards

Steps:
1.) Try to understand how to get data to a process variable from anywhere(lets say a clone of input/db)…
2.) Map the available data to the created form, to a text area, which is covered in this: http://community.bonitasoft.com/questions-and-answers/how-send-simple-data-instantiation-form-process-variable
3.) Try to replace it with the SQL connector… to get to the Form…

Regards,
Vivek