Case failing when query cannot execute

Hi Community

I have created a custom query in my BDM to seach a table based on user input. The Query is in JPQL.

In my service task, I call the tableDAO and call the custom query. 
If there is a valid search criteria, the query works fine. But for any other input which does not find any match, the query fails and the case goes into failed state.
How can i avoid that ? For events where user input is not matching, it should return null value.
But my case fails everytime user input does not match with records in table.

 

Please suggest what to do here ? How to avoid such scenario.

Regards

1 Like

Hi

What's your query?

Did you see errors in Bonita Log?

Some true query doesn't run in BDM.

Hello

The Query that I am using.

SELECT DISTINCT g 
FROM GTMDatabase g 
WHERE  g.buildingName LIKE :buildingName


The Query is working fine. When I pass a correct input. It is able to find the item and return output.
For a scenario where user input is not matching , in that case it fails.
Error log shows cannot find selected item.

But most importantly , the case fails.I dont want that

Regards

Can you pass zero or black instead of null value?

Where did you use the result of query ? It is possible that using of result causes error!