Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML export fixes #21

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<o:TypedCategoryTargetItem Id="896544FE-B9C0-47B5-A4EC-3C33B120B4CB">
<a:TypePublicName>CriterionTargetItem</a:TypePublicName>
<a:ObjectID>896544FE-B9C0-47B5-A4EC-3C33B120B4CB</a:ObjectID>
<a:Name>Criteria</a:Name>
<a:CreationDate>1716882613</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<o:CriterionTargetItem Id="A175F5B7-FE9F-4312-9248-A8D851CFC307">
<a:ObjectID>A175F5B7-FE9F-4312-9248-A8D851CFC307</a:ObjectID>
<a:Name>Export SourceObject ExpressionBusinessRule SqlExpression</a:Name>
<a:CriterionTargetItem.Value>%Model.mdde_Export_SourceObject_ExpressionBusinessRule_SqlExpression%</a:CriterionTargetItem.Value>
<a:CreationDate>1716882613</a:CreationDate>
<a:Creator>HarmenWessels</a:Creator>
<a:TargetCategory.Type>1</a:TargetCategory.Type>
<c:Categories>
<xi:include href="Extended_Attributes/Extended_Attributes.xml" />
</c:Categories>
</o:CriterionTargetItem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<o:TypedCategoryTargetItem Id="5F15B528-548B-41BE-9EF3-F5A13C5592B4">
<a:TypePublicName>ExtendedAttributeTargetItem</a:TypePublicName>
<a:ObjectID>5F15B528-548B-41BE-9EF3-F5A13C5592B4</a:ObjectID>
<a:Name>Extended Attributes</a:Name>
<a:CreationDate>1716882694</a:CreationDate>
<a:Creator>HarmenWessels</a:Creator>
<a:TargetCategory.Type>1</a:TargetCategory.Type>
<c:Categories>
<xi:include href="mdde_ParentAttributeFQCode.xml" />
</c:Categories>
</o:TypedCategoryTargetItem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<o:ExtendedAttributeTargetItem Id="AC1FE8D6-AC72-4421-9229-DADA2CCE8F04">
<a:ObjectID>AC1FE8D6-AC72-4421-9229-DADA2CCE8F04</a:ObjectID>
<a:Name>mdde_ParentAttributeFQCode</a:Name>
<a:CreationDate>1716562498</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)
&#39;Initialize the return value to an empty string.
%Get% = &quot;&quot;

&#39; Get the parent source object and attribute.
Dim objParentSourceObject : Set objParentSourceObject = obj.GetExtendedAttribute(&quot;mdde_ParentSourceObject&quot;)
Dim objParentAttribute : Set objParentAttribute = obj.GetExtendedAttribute(&quot;mdde_ParentAttribute&quot;)
Dim strParentLiteralValue : strParentLiteralValue = obj.GetExtendedAttribute(&quot;mdde_ParentLiteralValue&quot;)

&#39; If a literal value is specified, use that.
If Len(strParentLiteralValue) &gt; 0 Then
%Get% = strParentLiteralValue
&#39; If the child attribute is not empty, return the FQ name.
ElseIf Not(objParentSourceObject Is Nothing) And Not(objParentAttribute Is Nothing) Then
%Get% = objParentSourceObject.Code &amp; &quot;.&quot; &amp; objParentAttribute.Code
End If

End Function</a:GetMethodScript>
<a:Label>Fully qualified parent attribute code</a:Label>
</o:ExtendedAttributeTargetItem>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ChildAttribute=&quot;%mdde_JoinCondition_ChildAttribute_XmlExport_Template%&quot;
.endif
.if (%mdde_JoinOperator%)
JoinOperator=&quot;%mdde_JoinOperator%&quot;
JoinOperator=&quot;%.X:mdde_JoinOperator%&quot;
.endif
.if (%mdde_JoinCondition_ParentAttribute_XmlExport_Template%)
ParentAttribute=&quot;%mdde_JoinCondition_ParentAttribute_XmlExport_Template%&quot; ParentIsLiteralValue=&quot;%mdde_ParentIsLiteralValue%&quot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<xi:include href="Templates/Templates.xml" />
<xi:include href="Forms/Forms.xml" />
<xi:include href="Methods/Methods.xml" />
<xi:include href="Criteria/Criteria.xml" />
</c:Categories>
</o:StereotypeTargetItem>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
&#39; Get a reference to the child attribute of the join condition (which is the input attribute / parameter).
Dim objChildAttribute : Set objChildAttribute = objJoinCondition.GetExtendedAttribute(&quot;mdde_ChildAttribute&quot;)
&#39; Get the fully qualified parent attribute, so alias + attribute.
Dim strFQParentAttribute : strFQParentAttribute = objJoinCondition.GetExtendedAttribute(&quot;mdde_ParentAttributeSelector&quot;)
Dim strFQParentAttribute : strFQParentAttribute = objJoinCondition.GetExtendedAttribute(&quot;mdde_ParentAttributeFQCode&quot;)
&#39; Replace the parameter in the SQL Expression with the fully qualified parent attribute (or literal).
&#39; NOTE: the \b at the end make sure it&#39;s only replacing whole words (so if two parameters have overlapping names, like @A and @AA, it still works correctly).
oRegExp.Pattern = &quot;@&quot; &amp; objChildAttribute.Code &amp; &quot;\b&quot;
Expand Down
7 changes: 4 additions & 3 deletions decomposed/models/ExampleDWH/EXAMPLEDWH.model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<AggregateBusinessRule Id="B3B5F4BC-300B-4354-87E5-B5987AA01744" Code="Aggregate_Total_Sales_Per_Customer" Name="Aggregate Total Sales Per Customer" Stereotype="mdde_AggregateBusinessRule" />
<JoinConditions>
<JoinCondition ChildAttribute="CUSTOMERID" JoinOperator="=" ParentAttribute="&quot;Customer&quot;.&quot;ID&quot;" ParentIsLiteralValue="false" />
<JoinCondition ChildAttribute="TOTALREVENUE" JoinOperator="&gt;" ParentAttribute="0" ParentIsLiteralValue="true" />
</JoinConditions>
</SourceObject>
<SourceObject Id="BFE7CB1D-E29F-43F8-80A1-8A39D28FDA94" Code="Derive_Customer_FullName" Name="Derive Customer FullName" Stereotype="mdde_SourceObject" JoinedObject="Derive_Customer_FullName" JoinedObjectModel="EXAMPLEDWH" JoinType="APPLY">
Expand All @@ -192,14 +193,14 @@
<JoinCondition ChildAttribute="FIRST_NAME" JoinOperator="=" ParentAttribute="&quot;Customer&quot;.&quot;FIRSTNAME&quot;" ParentIsLiteralValue="false" />
<JoinCondition ChildAttribute="LAST_NAME" JoinOperator="=" ParentAttribute="&quot;Customer&quot;.&quot;LASTNAME&quot;" ParentIsLiteralValue="false" />
</JoinConditions>
<SqlExpression>Customer.FirstName || &#39; &#39; || Customer.LastName AS FULL_NAME</SqlExpression>
<SqlExpression>Customer.FIRSTNAME || &#39; &#39; || Customer.LASTNAME AS FULL_NAME</SqlExpression>
</SourceObject>
<SourceObject Id="6DB43891-22B1-48D1-8BDC-27987FA6D4D0" Code="Filter_FromNL" Name="Filter_FromNL" Stereotype="mdde_SourceObject" JoinedObject="Filter_FromNL" JoinedObjectModel="EXAMPLEDWH" JoinType="APPLY">
<FilterBusinessRule Id="E1395C49-53C1-4F30-A69D-5E523DF67CD1" Code="Filter_FromNL" Name="Filter_FromNL" Stereotype="mdde_FilterBusinessRule" />
<JoinConditions>
<JoinCondition ChildAttribute="COUNTRY_CODE" JoinOperator="=" ParentAttribute="&quot;Country&quot;.&quot;CODE&quot;" ParentIsLiteralValue="false" />
</JoinConditions>
<SqlExpression>Country.Code = &#39;NL&#39;</SqlExpression>
<SqlExpression>Country.CODE = &#39;NL&#39;</SqlExpression>
</SourceObject>
</SourceObjects>
<AttributeMappings>
Expand Down Expand Up @@ -371,7 +372,7 @@
<JoinCondition ChildAttribute="DATE_" JoinOperator="=" ParentAttribute="'2023-12-31'" ParentIsLiteralValue="true" />
<JoinCondition ChildAttribute="DATE_ORDER" JoinOperator="=" ParentAttribute="&quot;SalesOrder&quot;.&quot;ORDERDATE&quot;" ParentIsLiteralValue="false" />
</JoinConditions>
<SqlExpression>DATEDIFF(DAY, SalesOrder.OrderDate, &#39;2023-12-31&#39;) AS ORDER_AGE_IN_DAYS</SqlExpression>
<SqlExpression>DATEDIFF(DAY, SalesOrder.ORDERDATE, &#39;2023-12-31&#39;) AS ORDER_AGE_IN_DAYS</SqlExpression>
</SourceObject>
</SourceObjects>
<AttributeMappings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,30 @@
</o:ExtendedCollection>
</c:ExtendedCollections>
</o:ExtendedSubObject>
<o:ExtendedSubObject Id="85CFC2BE-B656-47C5-841E-AE65AE3D4D71">
<a:ObjectID>85CFC2BE-B656-47C5-841E-AE65AE3D4D71</a:ObjectID>
<a:Name>Join condition_2</a:Name>
<a:Code>Join_condition_2</a:Code>
<a:CreationDate>1716562359</a:CreationDate>
<a:Creator>HarmenWessels</a:Creator>
<a:Stereotype>mdde_JoinCondition</a:Stereotype>
<a:ExtendedAttributesText>{1626A879-DBAC-4E54-8A36-28FCB761FF3A},MDDE_LDM,130={2AA569D6-094E-4EA8-BBFF-713196E44D4E},mdde_JoinOperator,1=&gt;
{E9D50277-1E36-464C-9842-5008646943AB},mdde_ParentLiteralValue,1=0

</a:ExtendedAttributesText>
<c:ExtendedCollections>
<o:ExtendedCollection Id="20E4AF57-4F49-4E82-A5F4-D634372917E4">
<a:ObjectID>20E4AF57-4F49-4E82-A5F4-D634372917E4</a:ObjectID>
<a:Name>mdde_ChildAttribute</a:Name>
<a:ExtendedBaseCollection.CollectionName>mdde_ChildAttribute</a:ExtendedBaseCollection.CollectionName>
<a:CreationDate>1716562363</a:CreationDate>
<a:Creator>HarmenWessels</a:Creator>
<c:Content>
<o:EntityAttribute Ref="FA20EE0F-7D0C-4315-A5CC-CAFF7A32C2FC"/>
</c:Content>
</o:ExtendedCollection>
</c:ExtendedCollections>
</o:ExtendedSubObject>
</c:ExtendedComposition.Content>
</o:ExtendedComposition>
</c:ExtendedCompositions>
Expand Down
14 changes: 7 additions & 7 deletions decomposed/models/ExampleDWH/Model/a_ModelOptionsText.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\FILO\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_. &quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -79,7 +79,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\FRMEOBJ\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -107,7 +107,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\FRMELNK\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -135,7 +135,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\AREA\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -191,7 +191,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\LDMPCKG\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -275,7 +275,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\LDMPROP\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down Expand Up @@ -303,7 +303,7 @@ ConvTablePath=%_HOME%\Resource Files\Conversion Tables
[ModelOptions\Logical options\ClssNamingOptions\LDMIDTF\Code]
Template=
MaxLen=254
Case=U
Case=M
ValidChar=&#39;a&#39;-&#39;z&#39;,&#39;A&#39;-&#39;Z&#39;,&#39;0&#39;-&#39;9&#39;,&quot;_&quot;
InvldChar=
AllValid=No
Expand Down
Loading