Chain Of Responsibility Pattern

ATM Money Dispenser representing Chained or Chain of Responsibility Pattern

The AWS Step Functions Workflow is used to demonstrate how an ATM would be dispensing different types of bills until the entire requested amount is dispensed.
The state machine does this by utilizing the Chain Of Responsibility Pattern and going through the chain of tasks (AWS Lambda Functions) that dispense $50, $20, $10 & $1 bills. Each task would dispense its notes, update the amount ramaining to be dispensed and add the amount of notes it already dispensed. The output of that task will be passed as an input of the next one. At the end, if the requested amount to be dispensed was an integer, all the money should be dispensed and the ramaining dispense amount should be equal to 0

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/chain-of-responsibility/cd step-functions-workflows-collection/chain-of-respnsibility

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Additional resources

Created by:

Tsvetko Tsenkov

Tsvetko Tsenkov

Tsvetko is a Senior Partner Solutions Architect based out of Atlanta, GA.

Follow on LinkedIn