Skip to content

Commit 76cffba

Browse files
authored
Update Documentation.md
1 parent 6089ac0 commit 76cffba

File tree

1 file changed

+106
-6
lines changed

1 file changed

+106
-6
lines changed

Documentation/Documentation.md

Lines changed: 106 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,30 @@ Event | Description
233233

234234
When a Batch is executed, the following steps will take place:
235235

236-
![Run Batch](Images/RunBatch.png "Run Batch")
237-
236+
```mermaid
237+
flowchart TD
238+
%% Nodes
239+
240+
subgraph BatchInstance["Batch Instance"]
241+
Start("Start of the process"):::Main
242+
CreateBatchInstance
243+
BatchEvaluation{"BatchEvaluation"}
244+
RunModule("Run all Modules associated with the Batch")
245+
RunBatch("Run all (child) Batches associated with the Batch")
246+
UpdateBatchInstance
247+
End("End of the process"):::Main
248+
end
249+
250+
%% Edges
251+
Start --> CreateBatchInstance --> BatchEvaluation
252+
BatchEvaluation -- Internal Processing Status Code is not 'Abort' or 'Cancel' --> RunModule --> RunBatch
253+
BatchEvaluation -- Internal Processing Status Code is either 'Abort' or 'Cancel' --> End
254+
RunBatch --> UpdateBatchInstance
255+
UpdateBatchInstance --> End
256+
257+
%% Styling
258+
classDef Main fill:#BBDEFB,stroke:#1976D2,stroke-width:2px
259+
```
238260
#### Create new Batch Instance
239261

240262
This is the CreateBatchInstance event. This step inserts a new record in the `BATCH_INSTANCE` table based on the Batch ID with the:
@@ -264,7 +286,35 @@ If the evaluation finishes successfully and no issues have been encountered the
264286

265287
An overview of the Batch Evaluation steps is displayed in the following diagram:
266288

267-
![Batch Evaluation](Images/BatchEvaluation.png "Batch Evaluation")
289+
```mermaid
290+
flowchart TD
291+
%% Nodes
292+
293+
subgraph BatchEvaluation["Batch Evaluation"]
294+
Start("Start of the process"):::Main
295+
CheckMultiple("Check for multiple running Batch Instances")
296+
IsMultipleInstances{"Are multiple instances running?"}
297+
SetAbort("Update the Internal Processing Status Code to 'Abort'")
298+
IsActive{"Is the Batch enabled?"}
299+
SetCancel("Update the Internal Processing Status Code to 'Cancel'")
300+
IsRollback{"Is the rollback required?"}
301+
Rollback("Perform Rollback")
302+
End("End of the process"):::Main
303+
end
304+
305+
%% Edges
306+
Start --> CheckMultiple --> IsMultipleInstances
307+
IsMultipleInstances -- Yes --> SetAbort
308+
IsMultipleInstances -- No --> IsActive
309+
IsActive -- No --> SetCancel
310+
IsActive -- Yes --> IsRollback
311+
IsRollback -- Yes --> Rollback
312+
Rollback ----> End
313+
IsRollback -- No --> End
314+
315+
%% Styling
316+
classDef Main fill:#BBDEFB,stroke:#1976D2,stroke-width:2px
317+
```
268318

269319
The process is as follows:
270320

@@ -305,7 +355,29 @@ If a failure is detected at any time during this process the Execution Status Co
305355

306356
The Module execution process is as follows:
307357

308-
![Run Module](Images/RunModule.png "Run Module")
358+
```mermaid
359+
flowchart TD
360+
%% Nodes
361+
362+
subgraph ModuleInstance["Module Instance"]
363+
Start("Start of the process"):::Main
364+
CreateModuleInstance
365+
ModuleEvaluation{"ModuleEvaluation"}
366+
RunModule("Execute Module logic")
367+
UpdateModuleInstance
368+
End("End of the process"):::Main
369+
end
370+
371+
%% Edges
372+
Start --> CreateModuleInstance --> ModuleEvaluation
373+
ModuleEvaluation -- Internal Processing Status Code is not 'Abort' or 'Cancel' --> RunModule
374+
ModuleEvaluation -- Internal Processing Status Code is either 'Abort' or 'Cancel' --> End
375+
RunModule --> UpdateModuleInstance
376+
UpdateModuleInstance --> End
377+
378+
%% Styling
379+
classDef Main fill:#BBDEFB,stroke:#1976D2,stroke-width:2px
380+
```
309381

310382
#### Create new Module Instance
311383

@@ -333,7 +405,35 @@ The ModuleEvaluation event performs the sanity checks and housekeeping for the f
333405

334406
The process is as follows:
335407

336-
![Module Evaluation](Images/ModuleEvaluation.png "Module Evaluation")
408+
```mermaid
409+
flowchart TD
410+
%% Nodes
411+
412+
subgraph BatchEvaluation["Batch Evaluation"]
413+
Start("Start of the process"):::Main
414+
CheckMultiple("Check for multiple running Batch Instances")
415+
IsMultipleInstances{"Are multiple instances running?"}
416+
SetAbort("Update the Internal Processing Status Code to 'Abort'")
417+
IsActive{"Is the Batch enabled?"}
418+
SetCancel("Update the Internal Processing Status Code to 'Cancel'")
419+
IsRollback{"Is the rollback required?"}
420+
Rollback("Perform Rollback")
421+
End("End of the process"):::Main
422+
end
423+
424+
%% Edges
425+
Start --> CheckMultiple --> IsMultipleInstances
426+
IsMultipleInstances -- Yes --> SetAbort
427+
IsMultipleInstances -- No --> IsActive
428+
IsActive -- No --> SetCancel
429+
IsActive -- Yes --> IsRollback
430+
IsRollback -- Yes --> Rollback
431+
Rollback ----> End
432+
IsRollback -- No --> End
433+
434+
%% Styling
435+
classDef Main fill:#BBDEFB,stroke:#1976D2,stroke-width:2px
436+
```
337437

338438
1. If there are more running instances for the same Module only the first one is allowed to continue, the other active Instances must be aborted. This means that the current in-progress Module Instance for which the check is done needs to query if it itself is in the earliest (MIN) of the set of active Instances for the Module. If this is true, the Instance can continue. Otherwise it will be flagged to be aborted (Internal Processing Status Code `Abort`).This will trigger an update of the `MODULE_INSTANCE` table to set the Execution Status Code to `Aborted` for the current Instance and avoid executing of the regular Module logic
339439

@@ -477,4 +577,4 @@ If a rollback impacts a table associated with the source control logging table i
477577

478578
```sql
479579
DELETE FROM SOURCE_CONTROL WHERE MODULE_INSTANCE_ID IN (<Instance array>)
480-
```
580+
```

0 commit comments

Comments
 (0)