-
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.
* Result of PD merge * Added parent and child model to relationship export * Add SQL Expression on attribute mapping level * Update mdde_Mapping_Stereotyped_XmlExport_Template.xml * process review comments * process review comments * Process review comments * review comments * review comments * Updated upload artifacts action to v4. --------- Co-authored-by: Willem Otten <willem.otten@rabobank.com> Co-authored-by: Willem Otten <willem@crossbreeze.nl> Co-authored-by: Harmen Wessels <harmen@x-breeze.com>
- Loading branch information
1 parent
e652408
commit a6b7707
Showing
49 changed files
with
754 additions
and
85 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
...Custom_Checks/Check_window_business_rule_not_a_source_of_a_pivot_business_rule_(MDDE).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,42 @@ | ||
<o:CustomCheckTargetItem Id="C234C787-E4C5-4E8B-BD58-432AA676EF37"> | ||
<a:ObjectID>C234C787-E4C5-4E8B-BD58-432AA676EF37</a:ObjectID> | ||
<a:Name>Check window business rule not a source of a pivot business rule (MDDE)</a:Name> | ||
<a:CreationDate>1725522003</a:CreationDate> | ||
<a:Creator>DijkC1</a:Creator> | ||
<a:Comment>A window business rule cannot be used as a source for a pivot business rule.</a:Comment> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:HelpMessage>This check ensures that window business rules cannot be used as a source for a pivot business rule. </a:HelpMessage> | ||
<a:OutputMessage>The following objects have implemented window business rule where they are not allowed:</a:OutputMessage> | ||
<a:CheckScript>Function %Check%(obj) | ||
%Check% = True | ||
|
||
' Retrieve the source objects from the mapping. | ||
Dim colSourceObjects : Set colSourceObjects = obj.GetExtendedCollection("mdde_SourceObjects") | ||
|
||
' If the mapping has no source objects, stop here. | ||
If colSourceObjects.Count = 0 Then | ||
Exit Function | ||
End If | ||
|
||
Dim objSourceObject | ||
For Each objSourceObject In colSourceObjects | ||
Dim joinedObject : Set joinedObject = GetRealObject(objSourceObject.GetExtendedAttribute("mdde_JoinedObject")) | ||
If Not joinedObject Is Nothing Then | ||
If joinedObject.HasStereotype("mdde_WindowBusinessRule") Then | ||
%Check% = False | ||
WriteError joinedObject.DisplayName & " is a window business rule and cannot be used as source in a mapping on a pivot business rules." | ||
End if | ||
End If | ||
Next | ||
|
||
End Function</a:CheckScript> | ||
<a:AutoFixScrpt>Function %Fix%(obj, outmsg) | ||
' Implement your automatic correction on <obj> here | ||
' filling <outmsg> as you wish | ||
' and return True if successful. | ||
|
||
outmsg = "Automatic correction not implemented" | ||
|
||
%Fix% = False | ||
End Function</a:AutoFixScrpt> | ||
</o:CustomCheckTargetItem> |
11 changes: 11 additions & 0 deletions
11
...ing/Criteria/mdde_Criterion_ClassifierIsPivotBusinessRule/Custom_Checks/Custom_Checks.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="CF376183-4E9E-435F-B877-E4333D72215E"> | ||
<a:TypePublicName>CustomCheckTargetItem</a:TypePublicName> | ||
<a:ObjectID>CF376183-4E9E-435F-B877-E4333D72215E</a:ObjectID> | ||
<a:Name>Custom Checks</a:Name> | ||
<a:CreationDate>1736938699</a:CreationDate> | ||
<a:Creator>OttenW</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="Check_window_business_rule_not_a_source_of_a_pivot_business_rule_(MDDE).xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
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
82 changes: 82 additions & 0 deletions
82
...Custom_Checks/Check_window_business_rule_not_a_source_of_another_joined_object_(MDDE).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,82 @@ | ||
<o:CustomCheckTargetItem Id="FCCA60D2-047C-4361-8030-B1CBEC8AA429"> | ||
<a:ObjectID>FCCA60D2-047C-4361-8030-B1CBEC8AA429</a:ObjectID> | ||
<a:Name>Check window business rule not a source of another joined object (MDDE)</a:Name> | ||
<a:CreationDate>1724147078</a:CreationDate> | ||
<a:Creator>BuwaldaN</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:HelpMessage>This check ensures that the output of a window business rule cannot be used as the input of another joined object</a:HelpMessage> | ||
<a:OutputMessage>The following objects are using the output of a window business rule as the input of another joined object:</a:OutputMessage> | ||
<a:CheckScript>Function %Check%(obj) | ||
' Initialize the result with true. | ||
%Check% = True | ||
|
||
' Retrieve the source objects from the mapping. | ||
Dim colSourceObjects : Set colSourceObjects = obj.GetExtendedCollection("mdde_SourceObjects") | ||
|
||
' If the mapping has no source objects, stop here. | ||
If colSourceObjects.Count = 0 Then | ||
Exit Function | ||
End If | ||
|
||
|
||
' Now loop through all source objects. | ||
Dim objSourceObject | ||
For Each objSourceObject In colSourceObjects | ||
' Check if the joined objects is of type windowbusinessrule | ||
Dim joinedObject : Set joinedObject = GetRealObject(objSourceObject.GetExtendedAttribute("mdde_JoinedObject")) | ||
If Not joinedObject is Nothing Then | ||
If joinedObject.HasStereotype("mdde_WindowBusinessRule") Then | ||
'WriteDebug("joinedObject: " & joinedObject.ObjectType & " name: " & joinedObject.DisplayName & " stereotype " + joinedObject.StereoType) | ||
'WriteDebug("objSourceObject: " & objSourceObject.Code & " name: " & objSourceObject.DisplayName & " stereotype " + objSourceObject.StereoType) | ||
'call the function and if it returns true return an error | ||
Dim boolWindowFunctionUsedAsParent : boolWindowFunctionUsedAsParent = windowFunctionUsedAsParent(objSourceObject, colSourceObjects) | ||
If boolWindowFunctionUsedAsParent = True Then | ||
WriteError("The window function '" & objSourceObject.DisplayName & "' in mapping '" & objSourceObject.ParentObject.DisplayName & "' is used as the parent in another mapping.") | ||
%Check% = False | ||
End if | ||
End If | ||
End if | ||
Next | ||
|
||
End Function | ||
|
||
|
||
'Function that checks if a window function is used as the parent in another joined object on the same mapping | ||
Function windowFunctionUsedAsParent(ByRef objWindowFunctionSourceObject, ByRef colSourceObjects) | ||
' Initialize the result with false. | ||
windowFunctionUsedAsParent = False | ||
|
||
Dim objSourceObject | ||
For Each objSourceObject In colSourceObjects | ||
' Loop over the sourceobjects that are not the from and the window function object itself to determine if they have a join condition with the window function as parent | ||
If objSourceObject <> objWindowFunctionSourceObject Then | ||
If UCase(objSourceObject.GetExtendedAttributeText("mdde_JoinType")) <> "FROM" Then | ||
'WriteDebug("functionobjSourceObject: " & objSourceObject.ObjectType & " name: " & objSourceObject.DisplayName & " stereotype: " & objSourceObject.StereoType) | ||
' loop over the join conditions for the source object | ||
Dim objJoinCondition | ||
For Each objJoinCondition in objSourceObject.GetExtendedCollection("mdde_JoinConditions") | ||
Dim objParentSourceObject : Set objParentSourceObject = objJoinCondition.GetExtendedAttribute("mdde_ParentSourceObject") | ||
If Not objParentSourceObject is Nothing Then | ||
|
||
'WriteDebug("objParentSourceObject: " & objParentSourceObject.ObjectType & " name: " & objParentSourceObject.DisplayName & " stereotype: " & objParentSourceObject.StereoType) | ||
'if the parentobject is the window function object then set the variable to true | ||
If objParentSourceObject = objWindowFunctionSourceObject Then | ||
windowFunctionUsedAsParent = True | ||
Exit Function | ||
End if | ||
End if | ||
Next | ||
End if | ||
End if | ||
Next | ||
End Function</a:CheckScript> | ||
<a:AutoFixScrpt>Function %Fix%(obj, outmsg) | ||
' Implement your automatic correction on <obj> here | ||
' filling <outmsg> as you wish | ||
' and return True if successful. | ||
|
||
outmsg = "Automatic correction not implemented" | ||
|
||
%Fix% = False | ||
End Function</a:AutoFixScrpt> | ||
</o:CustomCheckTargetItem> |
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
27 changes: 27 additions & 0 deletions
27
...erion_IsMDDEDataSource/Custom_Checks/Check_data_source_acces_type_Is_read-only_(MDDE).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,27 @@ | ||
<o:CustomCheckTargetItem Id="7E963ECB-133F-4252-8652-347D96A4D90E"> | ||
<a:ObjectID>7E963ECB-133F-4252-8652-347D96A4D90E</a:ObjectID> | ||
<a:Name>Check data source acces type is read-only (MDDE)</a:Name> | ||
<a:CreationDate>1730454757</a:CreationDate> | ||
<a:Creator>DijkC1</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:HelpMessage>This check ensures that the datasource has the Access Type set to Read-Only</a:HelpMessage> | ||
<a:OutputMessage>The following objects do not pass custom check:</a:OutputMessage> | ||
<a:CheckScript>Function %Check%(obj) | ||
%Check% = True | ||
|
||
If obj.AccessType <> "RO" Then | ||
%Check% = False | ||
WriteError "Data source " & obj.DisplayName & " should have access type read-only" | ||
End if | ||
|
||
End Function</a:CheckScript> | ||
<a:AutoFixScrpt>Function %Fix%(obj, outmsg) | ||
%Fix% = False | ||
obj.AccessType = "RO" | ||
If obj.AccessType = "RO" Then | ||
%Fix% = True | ||
WriteInfo "Datasource " & obj.DisplayName & " set to Read-Only" | ||
End if | ||
End Function</a:AutoFixScrpt> | ||
<a:EnableAutoFix>1</a:EnableAutoFix> | ||
</o:CustomCheckTargetItem> |
11 changes: 11 additions & 0 deletions
11
...e/BaseDataSource/Criteria/mdde_Criterion_IsMDDEDataSource/Custom_Checks/Custom_Checks.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="55D68311-CF03-41A3-BB3B-6C9C8C8CBE10"> | ||
<a:TypePublicName>CustomCheckTargetItem</a:TypePublicName> | ||
<a:ObjectID>55D68311-CF03-41A3-BB3B-6C9C8C8CBE10</a:ObjectID> | ||
<a:Name>Custom Checks</a:Name> | ||
<a:CreationDate>1730454757</a:CreationDate> | ||
<a:Creator>DijkC1</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="Check_data_source_acces_type_is_read-only_(MDDE).xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
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
25 changes: 25 additions & 0 deletions
25
...IsMDDEMapping/Custom_Checks/Check_attribute_mapping_has_valid_target_attribute_(MDDE).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,25 @@ | ||
<o:CustomCheckTargetItem Id="278FD680-EA0D-49BF-A657-FBA47CE012C4"> | ||
<a:ObjectID>278FD680-EA0D-49BF-A657-FBA47CE012C4</a:ObjectID> | ||
<a:Name>Check attribute mapping has valid target attribute (MDDE)</a:Name> | ||
<a:CreationDate>1728549772</a:CreationDate> | ||
<a:Creator>DijkC1</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<a:HelpMessage>This check ensures that every attribute mapping has a valid target attribute. To correct this delete the attribute mapping and recreate it.</a:HelpMessage> | ||
<a:OutputMessage>The following objects do not pass custom check:</a:OutputMessage> | ||
<a:CheckScript>Function %Check%(obj) | ||
%Check% = True | ||
If obj.Feature Is Nothing Then | ||
%Check% = False | ||
WriteError("Mapping '" & obj.Parent.DisplayName & " on entity " & obj.Parent.Classifier.DisplayName & " is missing a target attribute in one of the attribute mappings.") | ||
End if | ||
End Function</a:CheckScript> | ||
<a:AutoFixScrpt>Function %Fix%(obj, outmsg) | ||
' Implement your automatic correction on <obj> here | ||
' filling <outmsg> as you wish | ||
' and return True if successful. | ||
|
||
outmsg = "Automatic correction not implemented" | ||
|
||
%Fix% = False | ||
End Function</a:AutoFixScrpt> | ||
</o:CustomCheckTargetItem> |
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
11 changes: 11 additions & 0 deletions
11
..._BusinessRuleWithoutMapping/Stereotypes/mdde_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="69723AD0-FBFD-40D1-BFCC-73527B302F80"> | ||
<a:TypePublicName>CriterionTargetItem</a:TypePublicName> | ||
<a:ObjectID>69723AD0-FBFD-40D1-BFCC-73527B302F80</a:ObjectID> | ||
<a:Name>Criteria</a:Name> | ||
<a:CreationDate>1724142194</a:CreationDate> | ||
<a:Creator>BuwaldaN</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="IsEntityNotWindowFunction/IsEntityNotWindowFunction.xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
5 changes: 2 additions & 3 deletions
5
...inessRule/Custom_Checks/Custom_Checks.xml → ...wFunction/Custom_Checks/Custom_Checks.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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
<o:TypedCategoryTargetItem Id="7BBEDCB3-FEE6-4532-9465-2D4764511DF3"> | ||
<o:TypedCategoryTargetItem Id="1DAAE9C4-578C-483D-BF9B-047769B1EDFF"> | ||
<a:TypePublicName>CustomCheckTargetItem</a:TypePublicName> | ||
<a:ObjectID>7BBEDCB3-FEE6-4532-9465-2D4764511DF3</a:ObjectID> | ||
<a:ObjectID>1DAAE9C4-578C-483D-BF9B-047769B1EDFF</a:ObjectID> | ||
<a:Name>Custom Checks</a:Name> | ||
<a:CreationDate>1657120038</a:CreationDate> | ||
<a:Creator>WesselsH1</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="mdde_ExpressionBusinessRule_Example_CheckAttributeAndValues.xml" /> | ||
<xi:include href="mdde_Check_BusinessRuleHasAtLeastOneExample.xml" /> | ||
<xi:include href="mdde_Check_BusinessRuleHasAtLeastOneInputAttribute.xml" /> | ||
</c:Categories> | ||
</o:TypedCategoryTargetItem> |
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
4 changes: 2 additions & 2 deletions
4
...sRule_Example_CheckAttributeAndValues.xml → ...sRule_Example_CheckAttributeAndValues.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
11 changes: 11 additions & 0 deletions
11
...e_ExpressionBusinessRule/Criteria/IsEntityNotWindowFunction/IsEntityNotWindowFunction.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:CriterionTargetItem Id="366C8C4C-536C-430D-A714-D5AA49608E63"> | ||
<a:ObjectID>366C8C4C-536C-430D-A714-D5AA49608E63</a:ObjectID> | ||
<a:Name>IsEntityNotWindowFunction</a:Name> | ||
<a:CriterionTargetItem.Value>%mdde_Entity_IsWindowBusinessRule% == "False"</a:CriterionTargetItem.Value> | ||
<a:CreationDate>1724142194</a:CreationDate> | ||
<a:Creator>BuwaldaN</a:Creator> | ||
<a:TargetCategory.Type>1</a:TargetCategory.Type> | ||
<c:Categories> | ||
<xi:include href="Custom_Checks/Custom_Checks.xml" /> | ||
</c:Categories> | ||
</o:CriterionTargetItem> |
Oops, something went wrong.