Hi
I have a Simple Process where Users can modify their information like first name , Last name and Mobile number.
For this, I have created a Table and Populated the table with users data.
Now in my process , I use a REST API to pull Data from the Table and display in the Form to the user.
Now user can modify the Existing Data and submit. This should update the First table row values for that user.
Now My Problem is I am unable to perform Update Operation of the table.
If I create a Object of the Table and use Operations to map the column in the left side and User input on the right side then in this case, it creates a New Row. It does not update the Existing Row.
Since I use REST API to pull data from the Table, hence there is no reference of the Row in the Context.
Kindly suggest what are the ways I can use to update existing data of any table.
If We need to use JPQL, then please suggest the steps to update BDM using JPQL.
regards
Hi, You should look for the row through a query and get the persistenceId then use the following code in Process Data
//Retrieve aggregated Proyectos using its DAO and persistenceId
def proyectosVar = proyectosDAO.findByPersistenceId(persistence.toLong())
proyectosVar.Estado = nuevoEstado;
return proyectosVar;
where persistence and nuevoEstado are contract data obtained from the form.
You could expand a little more on the solution, I’ve been trying to do this before with other options but I have not been successful. Where or how is this script placed, could you help me please?
Hi
This is how i proceed
Make sure to create Business Object of the particular table you want to work with.
Create a service or human task. Map a operation for the service/human task.
Left hand side, choose the table name , keep the middle section as it is (“Takes a value of”) and on the Right hand side , choose Query.
Use the Queries called FindByPersistenceId. You may need to pass the persistence Id as a parameter. You can fetch the persistence id from BDM using normal rest api call.
Also you can use all other Queries like Find by Request id or Find by requester name…depending upon your attributes.
This will load the Particular row from BDM into your context. Now you can use Context variable from Form to manipulate your BDM row item.
Let me know if this helps you.
regards
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.