For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
Hi, I have enabled delete operation in rest resource file but I want to first check order status of an order and if it is DRAFT then only delete is allowed.
where I can add this condition? currently delete is working for all the order status
User, tell us your exact JDev version, please! Have your tried to overwrite the remove() method of the VO and do the check there?
Timo
Thanks @timo-hahn1 , I have tried this solution and it worked out.
@timo-hahn1 , I have overridden remove method and it's working also. but the problem , I am not able to return any msg in API response if condition is not met because return type for remove() is void. is there any way so that I can return failure msgs when condition is not met.
you can throw a ValidationException with your message. This will be translated into a status 400 and the message will be passed as detail.
Yes Timo , but throwing an exception will give me 400 api response with incident log info in response.
I want a proper failure that needs to be returned in api response. so that UI team can fetch that msg
What do you mean by 'proper failure'? A return code of 400 means 'failure' in REST.
SELECT source_order_number, change_version_number, status_code, source_order_system, source_order_id FROM fusion.doo_headers_all WHERE status_code = 'DOO_DRAFT' ORDER BY creation_date DESC