How to get data from BDM when we have integer and string, both kinds of data types

1
0
-1

I have tried this querry
SELECT e
FROM Employee e
WHERE e.positionemp LIKE :positionemp
AND e.department LIKE :department
AND e.location LIKE :location
AND e.segement LIKE :segement
AND e.nationality LIKE :nationality
AND e.employeelastname LIKE :employeelastname
AND e.employeefirstname LIKE :employeefirstname
AND e.employeetype LIKE :employeetype
AND e.vaccineprovider LIKE :vaccineprovider
AND e.immunitystatus LIKE :immunitystatus
AND( e.emloyeeno = employeeno OR e.employeeno IS NULL)
AND( e.iqamano = iqamano OR e.iqamano IS NULL)
ORDER BY e.persistenceId DESC

where employeeno and iqamano are Integer and all others are string
Not able to get the data from buisness model when any integer attribute is added

Comments

Submitted by romain.bioteau on Wed, 07/28/2021 - 10:41

Did you miss the : before the employeeno and iqamano parameters ?

Like this

SELECT e
FROM Employee e
WHERE e.positionemp LIKE :positionemp
AND e.department LIKE :department
AND e.location LIKE :location
AND e.segement LIKE :segement
AND e.nationality LIKE :nationality
AND e.employeelastname LIKE :employeelastname
AND e.employeefirstname LIKE :employeefirstname
AND e.employeetype LIKE :employeetype
AND e.vaccineprovider LIKE :vaccineprovider
AND e.immunitystatus LIKE :immunitystatus
AND( e.emloyeeno = :employeeno OR e.employeeno IS NULL)
AND( e.iqamano = :iqamano OR e.iqamano IS NULL)
ORDER BY e.persistenceId DESC
Submitted by azade on Wed, 07/28/2021 - 10:49

I tried the same query still not working, it's giving the error as mentioned below

"exception": "class org.bonitasoft.engine.command.CommandExecutionException",

"message": "USERNAME=walter.bates | org.bonitasoft.engine.command.SCommandExecutionException: org.bonitasoft.engine.business.data.SBusinessDataRepositoryException: parameter(s) are missing for query named query1 : employeelastname,positionemp,employeetype,nationality,iqamano,employeefirstname,location,employeeno,department,segement,vaccineprovider,immunitystatus"

Submitted by romain.bioteau on Wed, 07/28/2021 - 10:59

How do you call your query ?

Submitted by azade on Wed, 07/28/2021 - 12:32

Fo this one I was checking in Postman

Submitted by azade on Wed, 07/28/2021 - 12:32

Fo this one I was checking in Postman

Submitted by romain.bioteau on Wed, 07/28/2021 - 12:41

And how do you pass the parameters in the query ?

Submitted by azade on Wed, 07/28/2021 - 12:44
Submitted by romain.bioteau on Wed, 07/28/2021 - 13:08

I mean, how do you pass the parameters when calling the query in postman ?

In your image: * employeelastname is an Integer ? *iqamano is a String ?

Submitted by azade on Wed, 07/28/2021 - 13:16

AHH ! That was just by mistake
In Postman I am just using GET method
http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Empl...

When I write a query SELECT e FROM Employee e and check on postman
I get whole data https://ibb.co/tq2FzJ6

Submitted by azade on Wed, 07/28/2021 - 16:53

Hello

just to simplify I added only 3 fields in the query https://ibb.co/Y3L7N5Q
in the GET API I added the prameters
http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Empl...

https://ibb.co/CKhx7Jd

and now I am able to get the data in postman but not on my UI designer form https://ibb.co/k97bvyP

1 answer

1
0
-1

Like explained in the documentation, you need to pass the parameters to your query using the f parameter like this:

http://localhost:8080/bonita/API/bdm/businessData/com.company.model.Employee?q=query1&p=0&c=10&f=positionemp=value&f=department=value...

HTH
Romain

Notifications