It is not generally recommended because it ties that rule service to a particular API endpoint so it makes it slower, more difficult to test, less portable etc.
The recommended approach is to make the call before you call the rules and pass the results of the call into ODM.
There are rare occasions when you do not know in advance which API to call or which data to pass it until you have executed some of the rules. In this case it is feasible to embed the API call part way through the ruleflow. I have built a demo which make a call to an external open source ML service to get a predictive score (built before the ML connectivitity was added to ODM 9.0).
Another example is where you are validating car servicing invoices where it is not practical to pass the cost and suitability of every car part of every make of car to the rules. So you could do this from within the rules once you know which ones you need to check. But again you may be able to do this outside the rules before the call to ODM.
------------------------------
Andy Macdonald
------------------------------
Original Message:
Sent: Tue January 07, 2025 12:50 AM
From: anubhav farkya
Subject: Calling an external API from IBM rule flow
I got a weird requirement about calling an external API within IBM ODM rule flow and route the flow based on the response. Just want to check if calling external API with IBM ODM rule flow is recommended or not.
------------------------------
anubhav farkya
------------------------------