duda con base de datos

1
0
-1

Hola soy nuevo en Bonita y tengo unas preguntas que necesito me ayuden, tengo el bonita 7.8.0 hice mi conexión con postgres perfectamente pero no sé como se agregan los usuarios que cree en la organización que tengo en Bonita Estudio dentro de la base de datos.

y la otra duda es con el método insertar cree una simple tabla llamada para agregar un nombre y una edad

INSERT INTO ejemplo(nombre, edad)
VALUES ('${minombre}', ${miedadX});

y cuando miro en la base de datos no inserta nada, que podría ser????

1 answer

1
+1
-1

Sorry I'll answer in English but maybe Google translate can help ;-)

In order to add users on a newly installed Bonita server you need first to connect to Bonita Portal with the tenant admin account (Community Edition allows only one tenant).

Then you can go in "Organization" menu, "Users" and click on the "Create" button.

Another option is to go in "Organization" menu, "Import / Export" and import an existing organization. You can for example create your organization in Bonita Studio (menu "Organization" -> "Define") and export it using the Studio menu "Organization" -> "Export".

About your question regarding data, I recommend to use the BDM feature of Bonita. You can find useful information in the documentation: https://documentation.bonitasoft.com/bonita/7.8/define-and-deploy-the-bdm and you can also watch the Bonita Camp video (Spanish version is a little bit all but still useful: https://www.youtube.com/watch?v=_3-itV9rEZ4)

Comments

Submitted by yuniet_1384540 on Tue, 03/05/2019 - 16:46

Thank you. Antoine.mottier but the problem is that inside the database I do not see any user, I do not know where it stores the users that are added to the Bonita portal. As for inserting, the problem lies in the integer value, does not allow me to insert the age.

Submitted by antoine.mottier on Wed, 03/20/2019 - 18:31

In bonita_journal database the information about users are stored in user_ table. But note that you should not update the information directly in the database but rather use Bonita Engine APIs.

As your data is related to users (it is not a generic business data such as invoice), I recommend to use the capabilities of Bonita user management.

In your organization definition you can add "Custom information": in the Studio go in the "Organization", "Define...", click Next to go to the last page and use the "User information management" tab to define a new "Custom information" (e.g. Age). Then you can define the value for each user. You can then access to the information using the CustomUserInfoAPI.

Submitted by yuniet_1384540 on Thu, 04/04/2019 - 15:17

ya encontré cual es el problema, bonita 7.8.0 que es la que estoy utilizando, tiene un error, no puedes crear una variable de tipo entero para agregar un valor de entero a la base de datos, por lo que tienes que crearlo de tipo texto y posteriormente lo tratas en la consulta como un numero.

Submitted by morongarciakaty... on Tue, 04/23/2019 - 19:46

hola me podrias indicar si te salio lo del insert porfa? soy nueva y necesito ayuda como insertar desde bonita a mi base de datos sql

Submitted by yuniet_1384540 on Thu, 04/25/2019 - 16:38

morongarciakaty, si lo resolví, explícame cual es tu problema para orientarte.
Mi problema eran los valores enteros que no me dejaba, ya que creaba la variable de ese mismo tipo y bonita no lo reconoce para pasárselo en la consulta a la base de datos, si quieres envíame el código

Submitted by morongarciakaty... on Thu, 04/25/2019 - 21:39

Hola gracias por la ayuda de antemano mi problema es q no inserta nada
he creado una base de datos bonita una tabla bonita y unos campos :diacotizacion, diasolictud,gestor 1,documnetacion,observacion. también en la base de datos creo mi usuario y le doy permisos estoy trabajando sql
en bonita tengo una tarea para insertar insertar ahi creo mis variables de proceso iguales a mis campos de mi tabla . tambien configure mi conector de salida insert into bonita (diaCotizacion,diaSolicitud,gestor1,observacion,documentacion)
values('${diaCotizacion}','${diaSolicitud}','${gestor1}','${observacion}','${documentacion}')

luego genero mi formulario pero cuando envio y verifico en sql no se inserta no se si estoy errando al poner el insert o al llamar desde mi formulario las variable del proceso
por ejemplo en el formulario creio una varibale external api cotizacion ../API/bpm/caseVariable/{{task.caseId}}/diaCotizacion y luego en el texto en valor ponlo cotizacion.value asi he visto q lo ponen pero no me funciona
ayudame

Submitted by morongarciakaty... on Thu, 04/25/2019 - 21:47
Submitted by yuniet_1384540 on Mon, 04/29/2019 - 15:50

katy me pide permiso para entrar al adjunto, ya te envié la solicitud de acceso

Submitted by antoine.mottier on Tue, 04/30/2019 - 14:16

About inserting data in a database not managed by Bonita (i.e. not the BDM database) I just publish an example. Note that it's using PostgreSQL but it should be pretty easy to adapt it to MySQL.

Also as a reminder if you don't have an existing database I always recommend to use BDM features to store your data.

If you need temporary storage of the data before pushing them in an external database I also recommend to store them temporarily in a business variable (it will use the BDM database) rather then in a process variable (it will use Bonita Engine database).

Submitted by antoine.mottier on Tue, 04/30/2019 - 20:00

Just some additional information after viewing your example:

  • In your example you are storing the data in process variables (diaCotizacion, diaSolicitud...). Those data will be store in Bonita Engine database. This lead to duplication with your own database and you probably don't want that.
  • Currently in your example you define a form on a task and initialize all the widgets using API calls to get the process variables values. As you didn't define any default values for the process variables, widgets in the form remains empty. When user input some values in the widgets, the form variables (e.g. cotizacion.value) will be updated to store the value. When the user click on the submit button, the current configuration of the button widget is to sent the content of formOutput variable. As this variable is empty and never updated an empty value is sent. Also on the task definition in Bonita Studio you didn't declare any contract so the task does no expect any input information. So plenty things are wrong in your current design. I really recommend to take a look at my example to see how you can capture user information in a form, sent them to the task using contract and using contract inputs to create an SQL query. But above that I would recommend to use the BDM feature that make all that a lot simpler.
Submitted by morongarciakaty... on Tue, 04/30/2019 - 21:28

Muchas gracias por tus comentarios ya he probado usando BDM pero tengo un incoveniente en mi base de datos sql tengo una fecha del tipo datetime y cuando trato de insertar no me sale pero cuando le pongo en la base de datos del tipo texto si me inserta sabes como lo puedo manejar??

Submitted by antoine.mottier on Thu, 05/02/2019 - 09:41

If you have issue with BDM and datetime type I recommend you create another question for this issue and attached your process as an example on this new question.

Notifications