Score:0

Delaying a Rules action until previous actions are complete

ao flag

I'm making an HTTP request in an action which obviously takes some time. I want to use the response of that request in another action, but every time I get an error since the request hasn't completed yet so the response variable is empty.

Specifically, I will save the json response from the first action and then pass it to a feed.

I'm using Drupal 8.

I've tried searching every form of words I can imagine and I have found only a single drupal.org thread from Drupal 7 days that didn't even have a solution.

Am I going about this the wrong way?

fr flag
It's really not clear what the problem is because you are talking about custom action code which you haven't posted. If you make a blocking HTTP request, then the code in the action will wait until the request is complete. I don't see where a race condition comes in. Likewise, Rules executes actions in rules one after another, and there's nothing special you have to do to make that happen.
yuuuu avatar
ao flag
I'm using the module "rules_http_client" which makes an HTTP request. I should have mentioned this. Currently I'm using a workaround that involves a custom action that just does everything I want in a single php file, but naturally if I can avoid this method it would be preferable.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.