diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cd4413a4..2a6d85254c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha - EdcPolicyDefinitionService, EdcContractDefinitionService and EdcAssetService return existing resource if it exists in EDC - Added AssetAdministrationShellDescriptor specificAssetIds support for externalSubjectId required for data provisioning -- Registering a job - aspects array is now accepting full urn of aspect model instead of name only, eg. 'urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt' instead 'SingleLevelBomAsBuilt' - #439 +- Registering a job - aspects array is now accepting full urn of aspect model instead of name only, eg. 'urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt' instead 'SingleLevelBomAsBuilt'. #439 ## [4.7.0] - 2024-03-04 ### Added diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java index 197193c0c8..498d3f09eb 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java @@ -203,7 +203,7 @@ private void validateAspectTypeValues(final List aspectTypeValues) { final List invalidAspectTypes = aspectTypeValues.stream() .filter(s -> !availableUrns.contains(s) || !s.matches( - "^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$")) + "^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$")) .toList(); if (!invalidAspectTypes.isEmpty()) { throw new IllegalArgumentException( diff --git a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterBatchOrder.java b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterBatchOrder.java index 371fa044f9..9a436a6b4f 100644 --- a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterBatchOrder.java +++ b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterBatchOrder.java @@ -80,7 +80,7 @@ }) public class RegisterBatchOrder { - private static final String ASPECT_MODEL_REGEX = "^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"; + private static final String ASPECT_MODEL_REGEX = "^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"; @NotEmpty @Valid diff --git a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterJob.java b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterJob.java index 7f7d4130a3..edcb0a4eaa 100644 --- a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterJob.java +++ b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/RegisterJob.java @@ -54,7 +54,7 @@ public class RegisterJob { private static final String MAX_TREE_DEPTH_DESC = "100"; private static final int MIN_TREE_DEPTH = 1; private static final int MAX_TREE_DEPTH = 100; - private static final String ASPECT_MODEL_REGEX = "^(urn:(b|s)amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"; + private static final String ASPECT_MODEL_REGEX = "^(urn:[bs]amm:.*\\d\\.\\d\\.\\d)?(#)?(\\w+)?$"; @NotNull @Valid diff --git a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/assetadministrationshell/SubmodelDescriptor.java b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/assetadministrationshell/SubmodelDescriptor.java index 5afe1061bf..0392407168 100644 --- a/irs-models/src/main/java/org/eclipse/tractusx/irs/component/assetadministrationshell/SubmodelDescriptor.java +++ b/irs-models/src/main/java/org/eclipse/tractusx/irs/component/assetadministrationshell/SubmodelDescriptor.java @@ -82,8 +82,8 @@ public String getAspectType() { /* package */ boolean isAspect(final String filterSemanticId) { return Optional.ofNullable(getAspectType()) .filter(aspect -> StringUtils.hasLength(filterSemanticId)) - .map(semanticId -> semanticId.contains(lowerCaseNameWithUnderscores(filterSemanticId)) - || semanticModelNamesMatchAndVersionIsInRange(semanticId, filterSemanticId)) + .map(aspect -> aspect.contains(lowerCaseNameWithUnderscores(filterSemanticId)) + || semanticModelNamesMatchAndVersionIsInRange(aspect, filterSemanticId)) .orElse(false); }