From d2c99c3396d824ed41c9681bfcead6c06524fe50 Mon Sep 17 00:00:00 2001 From: Harmen Wessels <97173058+harmen-xb@users.noreply.github.com> Date: Wed, 22 May 2024 12:50:23 +0200 Subject: [PATCH] Updated ExampleDWH model to enable exporting SQL Expression for expression business rule source objects. Updated Calculate_Order_Age so the parameter names are overlapping, to verify RegExp replace behavriour. --- .../models/ExampleDWH/EXAMPLEDWH.model.xml | 23 ++++++---- .../Calculate_Order_Age.xml | 28 +++++------ .../Derive_Customer_FullName.xml | 2 +- decomposed/models/ExampleDWH/ExampleDWH.ldm | 5 +- ...l_C2A6609F-EE69-45B9-B6D2-C363489ADA42.xml | 2 +- .../SalesOrder_Mapping.xml | 46 +++++++++---------- 6 files changed, 56 insertions(+), 50 deletions(-) diff --git a/decomposed/models/ExampleDWH/EXAMPLEDWH.model.xml b/decomposed/models/ExampleDWH/EXAMPLEDWH.model.xml index 8224a9b..c97c946 100644 --- a/decomposed/models/ExampleDWH/EXAMPLEDWH.model.xml +++ b/decomposed/models/ExampleDWH/EXAMPLEDWH.model.xml @@ -115,18 +115,20 @@ - Calculate the age of order + Calculate the age of order + + Note: the Date_ and Date_Order attribute names are like this to verify the behaviour of the RegExp replacement for the resolved SQL Expression in source objects where expression business rules are used. - - + + - DATEDIFF(DAY, @ORDER_DATE, @CURRENT_DATE) AS ORDER_AGE_IN_DAYS + DATEDIFF(DAY, @DATE_ORDER, @DATE_) AS ORDER_AGE_IN_DAYS - - + + @@ -190,12 +192,14 @@ + Customer.FirstName || ' ' || Customer.LastName AS FULL_NAME + Country.Code = 'NL' @@ -268,7 +272,7 @@ - FIRST_NAME || ' ' || LAST_NAME AS FULL_NAME + @FIRST_NAME || ' ' || @LAST_NAME AS FULL_NAME @@ -364,9 +368,10 @@ - - + + + DATEDIFF(DAY, SalesOrder.OrderDate, '2023-12-31') AS ORDER_AGE_IN_DAYS diff --git a/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Calculate_Order_Age.xml b/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Calculate_Order_Age.xml index ddd646b..ed1c79f 100644 --- a/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Calculate_Order_Age.xml +++ b/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Calculate_Order_Age.xml @@ -4,7 +4,9 @@ Calculate_Order_Age 1680508903 MooOthman -Calculate the age of order +Calculate the age of order + +Note: the Date_ and Date_Order attribute names are like this to verify the behaviour of the RegExp replacement for the resolved SQL Expression in source objects where expression business rules are used. ORG {41D1B62B-F9B1-4135-AF2D-439AFB15F96E} DAT 1680508903 ATT STRN @@ -18,7 +20,7 @@ ATT LABL {2B8936D7-8688-4269-BCA9-64EBA2E802A8},XBreeze_Model_Extension,66={29131F46-42B1-4DD8-9C6B-A955E3CD33F4},xm_stereotype,9=calculate -{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,125={38253E88-8698-4A5B-8398-0FA2B14556C0},mdde_SqlExpression,62=DATEDIFF(DAY, @ORDER_DATE, @CURRENT_DATE) AS ORDER_AGE_IN_DAYS +{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,118={38253E88-8698-4A5B-8398-0FA2B14556C0},mdde_SqlExpression,55=DATEDIFF(DAY, @DATE_ORDER, @DATE_) AS ORDER_AGE_IN_DAYS @@ -130,10 +132,19 @@ ATT LABL + +7B8233A5-359F-4372-9693-5AA2D4A3E458 +Date_ +DATE_ +1680525535 +MooOthman +mdde_InputAttribute +DT + 53DE74F2-F420-48D6-A2A7-176CC3150818 -Order Date -ORDER_DATE +Date_Order +DATE_ORDER 1680508903 MooOthman ORG {87D08732-95C1-401E-9FFF-33AB904D3D4B} @@ -144,15 +155,6 @@ ATT STRN mdde_InputAttribute DT - -7B8233A5-359F-4372-9693-5AA2D4A3E458 -Current Date -CURRENT_DATE -1680525535 -MooOthman -mdde_InputAttribute -DT - 742B3F05-D053-4323-9052-6D641E3BF52F Order Age In Days diff --git a/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Derive_Customer_FullName.xml b/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Derive_Customer_FullName.xml index f3e81d7..9c744e5 100644 --- a/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Derive_Customer_FullName.xml +++ b/decomposed/models/ExampleDWH/Entities/mdde_ScalarBusinessRule/Derive_Customer_FullName.xml @@ -6,7 +6,7 @@ MooOthman Merge the firstname and lastname of a customer. mdde_ScalarBusinessRule -{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,106={38253E88-8698-4A5B-8398-0FA2B14556C0},mdde_SqlExpression,43=FIRST_NAME || ' ' || LAST_NAME AS FULL_NAME +{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,108={38253E88-8698-4A5B-8398-0FA2B14556C0},mdde_SqlExpression,45=@FIRST_NAME || ' ' || @LAST_NAME AS FULL_NAME diff --git a/decomposed/models/ExampleDWH/ExampleDWH.ldm b/decomposed/models/ExampleDWH/ExampleDWH.ldm index 4bfc2cf..cf80cb2 100644 --- a/decomposed/models/ExampleDWH/ExampleDWH.ldm +++ b/decomposed/models/ExampleDWH/ExampleDWH.ldm @@ -44,9 +44,8 @@ DLD {CA5B68AA-5F42-423A-BA26-0A3F9DE54F2F} ATT DEFTXEM ATT OBJEXA -{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,96={3CB69645-4260-4DBC-A602-0536A9D4E6B3},mdde_Export_Extension_Initialization_Successful,5=false - -{0297A8FE-93C4-4612-A9E0-CD7292BFF652},MDDE_LDM_Export_Extension,70={AB204437-943D-4423-B8E6-E31186F8B700},mddex_Model_Export_Content,0= +{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,205={A3455CE1-6457-40F7-9C0B-599E355AF4DE},mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression,4=true +{3CB69645-4260-4DBC-A602-0536A9D4E6B3},mdde_Export_Extension_Initialization_Successful,5=false diff --git a/decomposed/models/ExampleDWH/LogicalDiagrams/ExampleDWH/Symbols/ExampleDWH_Symbol_C2A6609F-EE69-45B9-B6D2-C363489ADA42.xml b/decomposed/models/ExampleDWH/LogicalDiagrams/ExampleDWH/Symbols/ExampleDWH_Symbol_C2A6609F-EE69-45B9-B6D2-C363489ADA42.xml index 00cd1c6..6755a49 100644 --- a/decomposed/models/ExampleDWH/LogicalDiagrams/ExampleDWH/Symbols/ExampleDWH_Symbol_C2A6609F-EE69-45B9-B6D2-C363489ADA42.xml +++ b/decomposed/models/ExampleDWH/LogicalDiagrams/ExampleDWH/Symbols/ExampleDWH_Symbol_C2A6609F-EE69-45B9-B6D2-C363489ADA42.xml @@ -201,7 +201,7 @@ Entity.Comment 0 1712049767 -1 -((28875,824), (42075,6600)) +((28876,825), (42074,6599)) 16512 60416 12632256 diff --git a/decomposed/models/ExampleDWH/Mappings/mdde_ForHorizontalLineage/SalesOrder_Mapping.xml b/decomposed/models/ExampleDWH/Mappings/mdde_ForHorizontalLineage/SalesOrder_Mapping.xml index 3916d32..42bb83b 100644 --- a/decomposed/models/ExampleDWH/Mappings/mdde_ForHorizontalLineage/SalesOrder_Mapping.xml +++ b/decomposed/models/ExampleDWH/Mappings/mdde_ForHorizontalLineage/SalesOrder_Mapping.xml @@ -66,6 +66,29 @@ 1690285644 WesselsH1 + +2B08F648-7DE4-4F5D-B0CC-5BE0F94729DF +Join condition_2 +Join_condition_2 +1709911284 +HarmenWessels +mdde_JoinCondition +{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,80={E9D50277-1E36-464C-9842-5008646943AB},mdde_ParentLiteralValue,12='2023-12-31' + + + + +C41485A7-B110-438D-A20F-9E5950576C5D +mdde_ChildAttribute +mdde_ChildAttribute +1709911291 +HarmenWessels + + + + + + 2B91D851-B4F2-45B4-9762-0340E02D5CB2 Join condition_1 @@ -106,29 +129,6 @@ - -2B08F648-7DE4-4F5D-B0CC-5BE0F94729DF -Join condition_2 -Join_condition_2 -1709911284 -HarmenWessels -mdde_JoinCondition -{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,80={E9D50277-1E36-464C-9842-5008646943AB},mdde_ParentLiteralValue,12='2023-12-31' - - - - -C41485A7-B110-438D-A20F-9E5950576C5D -mdde_ChildAttribute -mdde_ChildAttribute -1709911291 -HarmenWessels - - - - - -