-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/xml export mapping br sql expression (#20)
* Added model option to export resolved expression business rule SQL Expression and added extended attribute and template change to implement it. * 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. * Removed unneeded debug output. * Fixed typo in the description of the indicator. * Added form on model level to configure XML export. * Added configurating the XML export in the manual (and renamed export extension). * Fixed typo and added note and syncing settings. * Fixed typo.
- Loading branch information
Showing
21 changed files
with
196 additions
and
52 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...ressionBusinessRule/Criteria/SourceObject_Is_ExpressionBusinessRule/Criteria/Criteria.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<o:TypedCategoryTargetItem Id="358ABFDA-AFCE-4EC9-84B4-426C8D6B94AE"> | ||
<a:TypePublicName>CriterionTargetItem</a:TypePublicName> | ||
<a:ObjectID>358ABFDA-AFCE-4EC9-84B4-426C8D6B94AE</a:ObjectID> | ||
<a:Name>Criteria</a:Name> | ||
<a:CreationDate>1716368643</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="Export_SourceObject_ExpressionBusinessRule_SqlExpression/Export_SourceObject_ExpressionBusinessRule_SqlExpression.xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
14 changes: 14 additions & 0 deletions
14
...onBusinessRule_SqlExpression/Export_SourceObject_ExpressionBusinessRule_SqlExpression.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<o:CriterionTargetItem Id="B563A315-904B-4685-8EB7-AB8793FE4DDC"> | ||
<a:ObjectID>B563A315-904B-4685-8EB7-AB8793FE4DDC</a:ObjectID> | ||
<a:Name>Export SourceObject ExpressionBusinessRule SqlExpression</a:Name> | ||
<a:CriterionTargetItem.Value>%Model.mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression%</a:CriterionTargetItem.Value> | ||
<a:CreationDate>1716368643</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:ParentCriterion> | ||
<o:CriterionTargetItem Ref="1940325C-3F83-4AB2-ABD7-BAA59E936DB1"/> | ||
</c:ParentCriterion> | ||
<c:Categories> | ||
<xi:include href="Extended_Attributes/Extended_Attributes.xml" /> | ||
</c:Categories> | ||
</o:CriterionTargetItem> |
11 changes: 11 additions & 0 deletions
11
...ceObject_ExpressionBusinessRule_SqlExpression/Extended_Attributes/Extended_Attributes.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<o:TypedCategoryTargetItem Id="3361082C-4ED3-4C1F-8BA0-2599D41B3D67"> | ||
<a:TypePublicName>ExtendedAttributeTargetItem</a:TypePublicName> | ||
<a:ObjectID>3361082C-4ED3-4C1F-8BA0-2599D41B3D67</a:ObjectID> | ||
<a:Name>Extended Attributes</a:Name> | ||
<a:CreationDate>1716368729</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="mdde_SqlExpression.xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
40 changes: 40 additions & 0 deletions
40
...rceObject_ExpressionBusinessRule_SqlExpression/Extended_Attributes/mdde_SqlExpression.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<o:ExtendedAttributeTargetItem Id="4BEE4FAB-A303-4B12-ACC8-B54CCCED485B"> | ||
<a:ObjectID>4BEE4FAB-A303-4B12-ACC8-B54CCCED485B</a:ObjectID> | ||
<a:Name>mdde_SqlExpression</a:Name> | ||
<a:CreationDate>1716367064</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:ExtendedAttributeTargetItem.DataType>12</a:ExtendedAttributeTargetItem.DataType> | ||
<a:Computed>1</a:Computed> | ||
<a:ComputedAccessType>RO</a:ComputedAccessType> | ||
<a:GetMethodScript>Function %Get%(obj) | ||
' Get the expression business rule object. | ||
Dim objExpressionBusinessRule : Set objExpressionBusinessRule = GetRealObject(obj.GetExtendedAttribute("mdde_JoinedObject")) | ||
|
||
' Get the SQL Expression from the business rule. | ||
Dim strSqlExpression : strSqlExpression = objExpressionBusinessRule.GetExtendedAttribute("mdde_SqlExpression") | ||
|
||
' Create a new RegExp object. | ||
Dim oRegExp : Set oRegExp = New RegExp | ||
' Replace all occurances. | ||
oRegExp.Global = True | ||
|
||
' Loop over the join conditions and replace the parameters in the SQL Expression with the mapped parent attribute from the join condition. | ||
Dim colJoinConditions : Set colJoinConditions = obj.GetExtendedCollection("mdde_JoinConditions") | ||
Dim objJoinCondition | ||
For Each objJoinCondition In colJoinConditions | ||
' Get a reference to the child attribute of the join condition (which is the input attribute / parameter). | ||
Dim objChildAttribute : Set objChildAttribute = objJoinCondition.GetExtendedAttribute("mdde_ChildAttribute") | ||
' Get the fully qualified parent attribute, so alias + attribute. | ||
Dim strFQParentAttribute : strFQParentAttribute = objJoinCondition.GetExtendedAttribute("mdde_ParentAttributeSelector") | ||
' Replace the parameter in the SQL Expression with the fully qualified parent attribute (or literal). | ||
' NOTE: the \b at the end make sure it's only replacing whole words (so if two parameters have overlapping names, like @A and @AA, it still works correctly). | ||
oRegExp.Pattern = "@" & objChildAttribute.Code & "\b" | ||
'WriteDebug("Replacing '" & oRegExp.Pattern & "' with '" & strFQParentAttribute & "'") | ||
strSqlExpression = oRegExp.Replace(strSqlExpression, strFQParentAttribute) | ||
Next | ||
|
||
%Get% = strSqlExpression | ||
End Function</a:GetMethodScript> | ||
<a:Label>Business Rule Source Object SQL Expression</a:Label> | ||
</o:ExtendedAttributeTargetItem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...del/Extended_Attributes/mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<o:ExtendedAttributeTargetItem Id="A3455CE1-6457-40F7-9C0B-599E355AF4DE"> | ||
<a:ObjectID>A3455CE1-6457-40F7-9C0B-599E355AF4DE</a:ObjectID> | ||
<a:Name>mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression</a:Name> | ||
<a:CreationDate>1716368457</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:Comment>Indicator whether to include the resolved SQL expression of expression business rules (like scalar and filter) in the XML export of source objects.</a:Comment> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:ExtendedAttributeTargetItem.Value>false</a:ExtendedAttributeTargetItem.Value> | ||
<a:Label>Export SourceObject ExpressionBusinessRule SQL Expression</a:Label> | ||
</o:ExtendedAttributeTargetItem> |
11 changes: 11 additions & 0 deletions
11
decomposed/extensions/MDDE_LDM/Profile/Model/Forms/Forms.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<o:TypedCategoryTargetItem Id="F1C3F8C5-1474-4721-B59A-5FD6DB9C3D81"> | ||
<a:TypePublicName>FormTargetItem</a:TypePublicName> | ||
<a:ObjectID>F1C3F8C5-1474-4721-B59A-5FD6DB9C3D81</a:ObjectID> | ||
<a:Name>Forms</a:Name> | ||
<a:CreationDate>1716375491</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="mdde_XmlExportConfiguration.xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
13 changes: 13 additions & 0 deletions
13
decomposed/extensions/MDDE_LDM/Profile/Model/Forms/mdde_XmlExportConfiguration.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<o:FormTargetItem Id="82A848B3-38C7-40F2-AB0F-ECE90F5DB908"> | ||
<a:ObjectID>82A848B3-38C7-40F2-AB0F-ECE90F5DB908</a:ObjectID> | ||
<a:Name>mdde_XmlExportConfiguration</a:Name> | ||
<a:FormTargetItem.Value><Form > | ||
<StaticText Name="XML Export Configuration" Caption="With the options below you can enable/disable the export of certain metadata.\n\nThe reason to disable unneeded metadata is to increase the export speed and keep the model export as small as possible." /> | ||
<ExtendedAttribute Attribute="mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression" Caption="SourceObject &lt;&lt;ExpressionBusinessRule&gt;&gt; SQL Expression" AttributeID="{A3455CE1-6457-40F7-9C0B-599E355AF4DE}" GrayHiddenAttributes="Yes" Display="Checkbox" LeftText="No" /> | ||
</Form> | ||
</a:FormTargetItem.Value> | ||
<a:CreationDate>1716375491</a:CreationDate> | ||
<a:Creator>HarmenWessels</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:Label>XML Export (MDDE)</a:Label> | ||
</o:FormTargetItem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.