diff --git a/content/docs/patterns/command-queue/index.md b/content/docs/patterns/command-queue/index.md index aec2e223..cdd41e57 100644 --- a/content/docs/patterns/command-queue/index.md +++ b/content/docs/patterns/command-queue/index.md @@ -7,14 +7,17 @@ categories: ["Pattern"] _Created by Patrick Schiefer, Described by Patrick Schiefer_ ## Abstract -The goal of this pattern is to control the flow of multiple actions +The goal of this pattern is to control the flow of multiple processes ## Problem -Sometimes its neccassary to perform multiple actions in Business Central, for example you want to post more than one order or before you post an Order you also have to post a purchase order this often leads to spaghetti code with big if else structures, which is not easy to read - +Sometimes its neccassary to perform multiple processes in Business Central, for example you want to post more than one order or before you post an Order you also have to post a purchase order this often leads to spaghetti code with big if else structures, which is not easy to read ## Description +The pattern is ideal for executing several independent processes in succession. Since the processes are independent, each process must take care of error handling itself. +The pattern should not be used to control a single process. + +## The Pattern To structure this problem we can use the "Command Queue" pattern. The pattern consist of two main parts the queue and the command interface ![image](queue.png) @@ -211,6 +214,7 @@ codeunit 50105 PatchPostQueue ``` + ## References [Detailed Explanation of the pattern](https://patrickschiefer.wordpress.com/2022/02/24/part-2-how-to-implement-a-command-queue-in-pure-al/)