From the course: AWS for Developers: SNS, SQS, and SWF

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

SWF deciders

SWF deciders

- [Instructor] Copy up to the server the file EnrollmentDecider.php. The first thing our decider does is poll for a decision task, and you can see how this lines up with step three in the AWS docs. The response from poll decision task will include a JSON object with an array of history events for this workflow execution. This events array will match the data you see in the SWF Console on the events tab, and the array is sorted so that the newest events will appear at the top. Our decider will loop over the event history for this workflow execution, and whenever it sees the event type matching activity task completed, it'll look at the returned result from the worker, and then decide the next course of action. Now we don't have any activity task completed events yet because the workflow just started, so it's just going to drop out of this loop, and just do the default action. If it didn't find activity tasks…

Contents