Hope you’re doing good!
I had a query regarding the use of the “requestHandled” callback function while executing an HTTP request in an EPL app.
My main question is about sending a parameter in this function. As we see here, there is no parameter passed in this function, but there is a Response parameter passed to it by default in the function definition:
Is it possible to send another parameters to this function? I tried doing so but it threw some errors stating that it accepts only one parameter.
Our use case is to extract a URL from the response and assign it to a global variable and then pass that global variable to another action sendOperation. But due to some reason, when we call sendOperation and pass the URL global variable as a parameter, it receives an empty string. This means that sendOperation is called before the URL is assigned to the global variable in requestHandled action. To prevent this, I have tried a workaround to wait for a few seconds and then call sendOperation().
Waiting allows the URL to be assigned to the global variable and it then works fine. However it is not a suitable approach (for obvious reasons).
Now, the reason why sendOperation action is not being called from inside the requestHandled action is that it requires an Event Type parameter (e) which cannot be sent through the requestHandled action (since it cannot accept another parameter apart from Response).
This brings us to the main question: Is there a way to send another parameter to the requestHandled callback action so that we can send the Event parameter through it and thereby call the sendOperation action from inside the requestHandled action, by which we can avoid waiting for a few seconds?
Please help me find a better approach to execute our use case efficiently.