diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASVisitor.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASVisitor.java index 781ae2168..5f393396a 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASVisitor.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASVisitor.java @@ -358,13 +358,12 @@ private void createConceptDescription( final Property property, final Context co if ( property.getCharacteristic().isEmpty() ) { return; } - final Characteristic characteristic = property.getCharacteristic().get(); // check if the concept description is already created. If not create a new one. if ( !context.hasEnvironmentConceptDescription( property.getAspectModelUrn().toString() ) ) { final ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() - .idShort( characteristic.getName() ) - .displayName( LangStringMapper.NAME.map( characteristic.getPreferredNames() ) ) + .idShort( ID_PREFIX + property.getName() ) + .displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) ) .embeddedDataSpecifications( extractEmbeddedDataSpecification( property ) ) .id( DEFAULT_MAPPER.determineIdentifierFor( property ) ) .build(); diff --git a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASGeneratorTest.java b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASGeneratorTest.java index 9dd6db755..6b78d57b1 100644 --- a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASGeneratorTest.java +++ b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASGeneratorTest.java @@ -289,15 +289,17 @@ void testGenerateAasxFromAspectModelWithEnumeration() throws IOException, Deseri assertEquals( 2, env.getConceptDescriptions().size() ); - final DataSpecificationIec61360 dataSpecificationContent = (DataSpecificationIec61360) env.getConceptDescriptions().stream() - .filter( conceptDescription -> conceptDescription.getIdShort().equals( "TestEnumeration" ) ) - .findFirst() - .get() - .getEmbeddedDataSpecifications() - .stream() - .findFirst() - .get() - .getDataSpecificationContent(); + final DataSpecificationIec61360 dataSpecificationContent = + (DataSpecificationIec61360) + env.getConceptDescriptions().stream() + .filter( x -> x.getIdShort().equals( "id_testProperty" ) ) + .findFirst() + .get() + .getEmbeddedDataSpecifications() + .stream() + .findFirst() + .get() + .getDataSpecificationContent(); assertEquals( 3, dataSpecificationContent.getValueList().getValueReferencePairs().size() ); assertEquals( 1, env.getSubmodels().size() );