Call a business data (custom) query with multiple filter

1
0
-1

Hey guys,
I created a table like in the "getting started tutorial": https://www.bonitasoft.com/resources/videos/getting-started-tutorial?des... and everything works fine.

But now I want to get my table filled not with items via one filter, but with two.
So the actual code looks like this and its working:
../API/bdm/businessData/com.company.model.ManuskriptEinsenden?q=findByUserAndStatus&p=0&c=10&f=userId={{session.user_id}}&f=status=abgelehnt

So Im getting all my items with the status "abgelehnt". But now I want to get all items with the status "abgelehnt" and "akzeptiert". And I tried few different ways but nothing works.

Also I have only 3 types of status: "abgelehnt", "akzeptiert" and "in%20Bearbeitung". So I thought that I could just filter out the two by writting: "...&f=status!=in%20Bearbeitung", but this also doesnt work.

1 answer

1
0
-1
This one is the BEST answer!

If sb read this and has the same question. I got it. You have to create a custom query, sth like this:
SELECT m
FROM ManuskriptEinsenden m
WHERE m.userId = :userId
AND ( m.status = :status1
OR m.status = :status2)
ORDER BY m.persistenceId ASC

and then just call it via external api : ../API/bdm/businessData/com.company.model.ManuskriptEinsenden?q=findByUserAndTwoStatus&p=0&c=10&f=userId={{session.user_id}}&f=status1=akzeptiert&f=status2=abgelehnt

Notifications