SQL -insertar datos cuando se apruebe una solicitud

1
0
-1

Hola alguien me puede ayudar tengo un proceso para gestion de documentación en mi tarea 1 un usuario ingresa fecha su nombre y documentos y observaciones lo he conectado sql y puedo insertar todo bien .en mi segunda tarea otro usuario solo puede ver los datos anteriores solo lectura y tiene un boton de aprobar y desaprobar y ahi esta el problema no se como puedo hacer para que en mi base de datos sql se guarde quien aprueba y la fecha en que lo aprueba o rechaza .soy nueva en bonita aayudenmen porfa.

porfa quien me puede ayudar ??' estoy verrsion 7.8.3 bonita

1 answer

1
0
-1

I'll answer in English, sorry but hopefully Google translate can help.

When a user submit a form in Bonita to perform a task, information about who perform the task and when he/she did it are stored automatically by the Bonita Engine. Such information are available using the Bonita API.

So you don't need to store them in your own database or in a process business variable. Just use the API when you need to access them.

Comments

Submitted by morongarciakaty... on Fri, 05/10/2019 - 17:02

hola entiendo que se guarda bd h2 pero yo lo quiero guardar en otra bd sql
tengo dos tareas .la primera su BDM tiene datos: nombre ,fecha ,observación , aprobado que es tipo boolen
OK en la segunda tarea en su contrato solo cree una variable tipo boolean asi que cuando genero mi formulario lo que hago es solo llamr a BDM de la primera tarea . arrastro dos botones aprobado y rechazado en cada uno ensu propiedad de valor pongo {"aprobado" : true} ,{"aprobado" : false}
forma 1 usando el editor consulta o lotes de secuencia de comando
cuando lo hago de esta forma me inserta bien pero no esta reconociendo cuando es aprobado o rechazado ya que por defecto le estoy poniendo uno lo que quiero es que cuando se rechaze en mi base datos se ponga 0
insert into aprobacion(usuario,fecha,estado,numeroCaso,numeroTarea)
values('elmner',getdate(),1,${validar.numeroCaso},${validar.numeroTarea})

forma 2 si hago clic cambiar editor y uso script si me acepta y me inserta en BD como quiero pero no me reconoce '${validar.numeroCaso}'

if (aprobado ==true){
"insert into aprobacion(usuario,fecha,estado,numeroCaso,numeroTarea) values('elmner',getdate(),1,${validar.numeroCaso},${validar.numeroTarea})"
}
else if (aprobado ==false)
{
"insert into aprobacion(usuario,fecha,estado,numeroCaso,numeroTarea) values('elmner',getdate(),0,${validar.numeroCaso},${validar.numeroTarea})"
}

me pueden orientar

Submitted by antoine.mottier on Mon, 05/13/2019 - 18:06

Just to make sure I'm understand correctly can you confirm that:

  1. You don't want to use the BDM feature even if you can use your own MySQL, PostgreSQL, Oracle and Microsoft SQL Server to store the BDM data.
  2. You want to use an existing Microsoft SQL Server database.

If you confirm that I recommend first to delete from your example the Business Data Model, remove the business variable that is declared in your process definition and update all the code that was using this business variable.

Once you did that if you can share this update version of the example I can try to help from there.

Notifications