Untitled

 avatar
MouxGeor
plain_text
a year ago
2.0 kB
2
Indexable
Never
Initially, we start with MT_BSN_DT_CHK, where the flow checks if the previous day is a working day since the data used as a source is from the previous day. If the previous day is a working day, it indicates that there is data available to pull. For example, if the flow runs on a Saturday, it retrieves data from Friday; if it runs on Tuesday, it retrieves data from Monday, and so on. Subsequently, if there is a previous working day, we proceed to TF_TBRP_EXECUTOR; otherwise, the flow terminates.

Within TF_TBRP_EXECUTOR, we begin with MT_ORACLE_BSNDT, where we fetch the last date (d_lastrun) when data was loaded from Oracle, and we set this date in the table DWHINPSTG.PRXMAFLODT created in the HERA system. We then utilize a COUNTER that keeps track of the number of times we fail to obtain the correct date and consequently encounter a situation with no data. In such cases, the flow redirects back to MT_ORACLE_BSNDT. Moving forward, we enter MT_DT_CHK_ORACLE, which retrieves the BSNDT from EXTLOG, where TBLID = 701, referring to the file received, PRXMINVC, from QUALCO. If BSNDT is NULL, implying there are no records for that specific date, the flow proceeds to DECISION 1, where we populate the tables DWHEXT.PRXMINVC & DWHEXT.PRXMTRN and subsequently terminate the flow.

On the other hand, if there are records for the given date and the COUNTER used earlier is less than 9, the flow waits for 30 minutes and then returns to the MT_ORACLE_BSNDT step. However, if the COUNTER is equal to 9, the flow inserts dummy data into the tables DWHEXT.PRXMINVC & DWHEXT.PRXMTRN. These dummy data entries are pre-defined to indicate that no valid data was found from Oracle for the current date, and an error message is sent to datawarehouse@piraeusbank.gr, reporting this issue. Additionally, if the date happens to be the last working day of the month, we request the RDO TEAM to be notified so that they can postpone the TrnBnkInvoices ETL Flow until the matter is resolved.