Skip to content
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
Expand Up @@ -291,8 +291,8 @@ end
rule "Relationships between business entities and nodes are consistent"
@problem("Business entity's node relationship is inconsistent")
when
/businessEntities[ $b: this, $businessEntityId: id, $nodeId: repeatsWithNodeId, repeatsWithNodeId != null ]
not (exists /nodes[ id == $nodeId, businessEntityId == $businessEntityId ])
/businessEntities[ $b: this, $nodeId: repeatsWithNodeId, repeatsWithNodeId != null ]
not (exists /nodes[ id == $nodeId ])
then
results.add(new ValidationResult($b, "Relationship with node " + $nodeId + " is incorrect", ValidationStatusEnum.ERROR, AssetRef.node($nodeId)));
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"description" : "Information on a tendering party",
"labelId" : "business-entity|name|tenderingParty",
"repeatable" : true,
"repeatsWithNodeId" : "ND-TenderingParty",
"repeatsWithNodeId" : "ND-TenderingPartyBAD",
"changeIdentification" : {
"identifyInChangeNotice" : true,
"useInstanceIdentifier" : true
Expand Down Expand Up @@ -1139,7 +1139,7 @@
"repeatable" : true,
"identifierFieldId" : "OPT-210-Tenderer",
"captionFieldId" : "OPT-211-Tenderer",
"businessEntityId" : "tender"
"businessEntityId" : "tenderingParty"
}, {
"id" : "ND-SubContractor",
"parentId" : "ND-TenderingParty",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"ublVersion" : "2.3",
"sdkVersion" : "eforms-sdk-1.21.0-SNAPSHOT",
"metadataDatabase" : {
"version" : "1.12.0",
"createdOn" : "2024-06-01T00:00:00"
},
"businessEntities" : [ {
"id" : "BuyerOrganisation",
"name" : "Buyer organisation",
"description" : "An organisation acting as a buyer",
"labelId" : "business-entity|name|BuyerOrganisation",
"repeatable" : true,
"repeatsWithNodeId" : "ND-Organization"
}, {
"id" : "EconomicOperator",
"name" : "Economic operator",
"description" : "An organisation acting as an economic operator",
"labelId" : "business-entity|name|EconomicOperator",
"repeatable" : true,
"repeatsWithNodeId" : "ND-DoesNotExist"
} ],
"xmlStructure" : [ {
"id" : "ND-Root",
"xpathAbsolute" : "/*",
"xpathRelative" : "/*",
"repeatable" : false
}, {
"id" : "ND-Organization",
"parentId" : "ND-Root",
"xpathAbsolute" : "/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization",
"xpathRelative" : "efac:Organization",
"xsdSequenceOrder" : [ { "efac:Organization" : 1 } ],
"repeatable" : true,
"businessEntityId" : "Organisation"
} ],
"fields" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"ublVersion" : "2.3",
"sdkVersion" : "eforms-sdk-1.21.0-SNAPSHOT",
"metadataDatabase" : {
"version" : "1.12.0",
"createdOn" : "2024-06-01T00:00:00"
},
"businessEntities" : [ {
"id" : "BuyerOrganisation",
"name" : "Buyer organisation",
"description" : "An organisation acting as a buyer",
"labelId" : "business-entity|name|BuyerOrganisation",
"repeatable" : true,
"repeatsWithNodeId" : "ND-Organization"
}, {
"id" : "EconomicOperator",
"name" : "Economic operator",
"description" : "An organisation acting as an economic operator",
"labelId" : "business-entity|name|EconomicOperator",
"repeatable" : true,
"repeatsWithNodeId" : "ND-Organization"
} ],
"xmlStructure" : [ {
"id" : "ND-Root",
"xpathAbsolute" : "/*",
"xpathRelative" : "/*",
"repeatable" : false
}, {
"id" : "ND-Organization",
"parentId" : "ND-Root",
"xpathAbsolute" : "/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization",
"xpathRelative" : "efac:Organization",
"xsdSequenceOrder" : [ { "efac:Organization" : 1 } ],
"repeatable" : true,
"businessEntityId" : "Organisation"
} ],
"fields" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@tedefo-5157
Feature: Fields - business entity node relationship (many-to-one)
TEDEFO-5157: A node may be shared by several business entities. The relationship
only requires the node referenced by "repeatsWithNodeId" to exist, regardless of
the node's own "businessEntityId".
Test files under "src/test/resources/eforms-sdk-tests/tedefo-5157"
Background:
Given The following rules
| Relationships between business entities and nodes are consistent |
Scenario: Several business entities share the same node
Given A "tedefo-5157" folder with "valid" files
When I load all nodes
And I load all business entities
And I execute validation
Then I should get 0 SDK validation errors
Scenario Outline: A business entity references a node that does not exist
Given A "tedefo-5157" folder with "invalid" files
When I load all nodes
And I load all business entities
And I execute validation
Then Rule "<expected rule>" should have been fired
And I should get 1 SDK validation error
Examples:
| expected rule |
| Relationships between business entities and nodes are consistent |
Loading