vendredi 3 décembre 2021

How to build architecture correctly

I have a task - to develop an application that performs a sequence of actions. Actions can be systemic (sending notifications by mail, entering data into the database), and actions that require human intervention (approval, upload a document). This process will often change and scale, and it is desirable that the employees themselves do this through a visual constructor. The main thing that I cannot understand is how to store the path of the process itself and how to determine which stage is next (perhaps there will also be checks and forks by type - if the employee confirmed the document, then do one thing, if not, then another). There is an idea to store the path as json:

"Steps": [
    {
      "Id": "Step1",
      "StepType": "Notification.email",
      "NextStepId": "Step2"
    },
    {
      "Id": "Step2",
      "StepType": "Employee.approve",
      "NextStepId": "Step3"
    }
]

But I'm not sure if this will be correct. Can anyone have any ideas on how best to implement this or do you already have ready-made patterns?

P.S. Presumably I will implement this in Node.js

Aucun commentaire:

Enregistrer un commentaire