You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/Documentation.md
+19-25Lines changed: 19 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,10 @@ If a failure is detected at any time during this process the Execution Status Co
303
303
304
304
### Module integration
305
305
306
+
The Module execution process is as follows:
307
+
308
+

309
+
306
310
#### Create new Module Instance
307
311
308
312
The CreateModuleInstance event will retrieve the Module details using the Module Code as input. This includes the `MODULE_ID` but also other relevant properties such as `AREA_CODE`, `TARGET_DATA_OBJECT`, and `FREQUENCY_CODE`.
@@ -329,37 +333,29 @@ The ModuleEvaluation event performs the sanity checks and housekeeping for the f
329
333
330
334
The process is as follows:
331
335
332
-
1. Check for multiple running instances; 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 same Module. If this is true the Instance can continue, otherwise it will be flagged to be aborted (Internal Processing Status Code `Abort`)
333
-
334
-
1. This value in of the Internal Processing Status Code 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 ETL logic
1.Validate Batch Execution. DIRECT will query the Batch information to validate if the Module was registered properly (i.e. contains an entry in the Batch/Module relationship table) when instantiated from a Batch. This check also takes into account the value of the `ACTIVE_INDICATOR` on Batch/Module level
338
+
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
337
339
338
-
1. If this value is set to `N` the current Instance will be skipped as this indicates the Module is disabled for the particular Batch
340
+
1.DIRECT will assess if the Module is enabled, either individually or when called from a Batch by checking the `ACTIVE_INDICATOR` value. If either the Module or Batch/Module equivalent value is set to `N`, the current Instance will be skipped as this indicates the Module is disabled for the particular Batch
339
341
340
-
1. Retrieve Previous Instance details. If allowed to continue the Module Evaluation then checks if the previous run(s) have failed or not. It will select the Next Run Status value from the previous Module Instance to direct the internal processing. If a failure is detected (the status of the previous instance Next Run Status is `Rollback`) this step will create an array of all Module Instances from the last logged successful run to the most recent (failed) run
341
-
342
-
1. This effectively selects multiple failed runs for rollback from the point where the run was last successful. This array of (failed) Module Instances will ultimately be used as the 'IN' clause of the Rollback SQL
342
+
1. Details of earlier instances will be retrieved to determine a rollback is required. It will select the Next Run Status value from the previous Module Instance to direct the internal processing. If a failure is detected (the status of the previous instance Next Run Status is `Rollback`) this step will create an array of all Module Instances from the last logged successful run to the most recent (failed) run This effectively selects multiple failed runs for rollback from the point where the run was last successful. This array of (failed) Module Instances will ultimately be used as the 'IN' clause of the Rollback SQL
343
343
344
344
1. Based on the result of this check the following scenarios are possible:
345
345
346
-
* If the previous (Module) Next Run Status is `Cancel` the run will be finished before the actual ETL starts. This can happen if:
347
-
* The system administrator has labelled this Module to be disabled for this run by manually setting the Next Run Status value to `Cancel` in the Module Instance.
348
-
* The previous Batch failed but the specific Module (Instance) was run successfully in that particular Batch and is skipped when the Batch is run again (rollback on Batch level)
349
-
346
+
* If the previous (Module) Next Run Status is `Cancel` the run will be finished before the actual Module execution starts. This can happen if:
347
+
* The system administrator has labelled this Module to be disabled for this run by manually setting the Next Run Status value to `Cancel` in the Module Instance.
348
+
* The previous Batch failed but the specific Module (Instance) was run successfully in that particular Batch and is skipped when the Batch is run again (rollback on Batch level)
350
349
* If the previous Module Next Run Status is `Rollback` (rollback) the rollback process is started (see Rollback section). The Rollback process uses the Area Code and Table Name to create dynamic SQL statements. After the rollback SQL has been executed correctly the Internal Processing Status Code is set to `Proceed` and processing will continue as usual.
351
350
352
-
1. The Module Evaluation effectively returns the Internal Processing Status Code for the current Module Instance. The next step for the processing is to interpret this indicator for the current Module Instance to either stop or continue the processing
351
+
#### Update the Module Instance
353
352
354
-
1. After the Module Evaluation is complete and the Internal Processing Status Code equal `Proceed`the regular ETL process can be executed. In other words, no regular processing is allowed unless this indicator is `Proceed`. This is the safety catch for the Module to start.
353
+
The Module Evaluation returns the Internal Processing Status Code for the current Module Instance. The next step for the processing is to interpret this indicator for the current Module Instance, to either stop or continue the processing
355
354
356
-
* If at this point the (Module) Internal Processing Status Code is `Cancel` the Module Instance record is updated to set the final Execution Status Code to `Cancel` and the End Date/Time to the current date/time value (sysdate, getdate or equivalent).
357
-
* If at this point the (Module) Internal Processing Status Code is `Abort` the Module Instance record is updated to set the final Execution Status Code to `Aborted` and the End Date/Time to the current date/time value (sysdate, getdate or equivalent).
358
-
* As mentioned, if the Internal Processing Status Code is `Proceed` the real ETL logic will be executed. No Modules are allowed to start unless this indicator equals `Proceed`
355
+
After the evaluation has completed without any issues, the Internal Processing Status Code of the Module Instance is checked.
359
356
360
-
#### Update the Module Instance
357
+
If the Internal Processing Status Code equals `Proceed`the regular process can be executed. In other words, no regular processing is allowed _unless_ this indicator is `Proceed`. This is the safety catch for the Module to start.
361
358
362
-
After the execution has completed without any issues, the Internal Processing Status Code of the Module Instance is checked.
363
359
364
360
If the Internal Processing Status Code is `Cancel`, the Module Instance is updated with:
365
361
@@ -373,7 +369,7 @@ If the Internal Processing Status Code is `Abort`, the Module Instance is update
373
369
* The Next Run Status as `Proceed` and
374
370
* End Date/Time as the current timestamp
375
371
376
-
If the Internal Processing Status Code is `Proceed` and the ETL runs without issues the Module Instance is updated to set the Execution Status Code to `Succesful`, the Next Run Status as `Proceed` and the current date/time as the End Date/Time.
372
+
If the Internal Processing Status Code is `Proceed` and the Module runs without issues the Module Instance is updated to set the Execution Status Code to `Succesful`, the Next Run Status as `Proceed` and the current date/time as the End Date/Time.
377
373
378
374
As a separate step the record counts are updated in the `MODULE_INSTANCE` table.
379
375
@@ -403,8 +399,8 @@ The Module registration is done by adding a record in the MODULE table with the
403
399
404
400
*`MODULE_ID`, this is a system generated ID that is used to unique identify a Module
405
401
*`AREA_CODE`, the Area as part of the Outline Architecture where the Module is part of. This identifies the type, template and purpose of the Module
406
-
*`MODULE_CODE`, this is the name of the Module (mapping name, child package; depending on the ETL software used)
407
-
*`MODULE_TYPE_CODE`, the type of Module (script, specific ETL job, etc.)
402
+
*`MODULE_CODE`, this is the name of the Module
403
+
*`MODULE_TYPE_CODE`, the type of Module (script, specific data processing job, etc.)
408
404
*`MODULE_DESCRIPTION`, the descriptive information of the Module
409
405
*`ACTIVE_INDICATOR`, indicate whether a Module is inactive and should be skipped during process execution
410
406
@@ -481,6 +477,4 @@ If a rollback impacts a table associated with the source control logging table i
481
477
482
478
```sql
483
479
DELETEFROM SOURCE_CONTROL WHERE MODULE_INSTANCE_ID IN (<Instance array>)
484
-
```
485
-
486
-
In other approaches, an option is to retain the load window until all related (Batch) processes have been successfully completed.
0 commit comments