You need to create a Business varialble of the Table that you want to work with.
Either , you can write the above script in the Initialize section of the Business variable.
Or
In a Human Task or Service Task ->go to Operation -> Add -> map business Variable on left side and add your script on the right hand side.
You must create a Business variable first and all database transaction must happen through operation section on Task
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.