Skip to content

Commit 3b65f04

Browse files
committed
Small bugfixes to add ModelingKind to SubmodelElementCollection generation and change example value for Property generation
Signed-off-by: Johannes Kristan <[email protected]>
1 parent 94491f0 commit 3b65f04

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/sds-aspect-model-aas-generator/src/main/java/io/openmanufacturing/sds/aspectmodel/aas/AspectModelAASVisitor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ private SubmodelElementCollection mapToAasSubModelElementCollection(
275275
.displayName( map( entity.getPreferredNames() ) )
276276
.description( map( entity.getDescriptions() ) )
277277
.value( submodelElements )
278+
.kind( ModelingKind.TEMPLATE)
278279
.build();
279280
}
280281

@@ -284,7 +285,7 @@ private org.eclipse.digitaltwin.aas4j.v3.model.Property mapToAasProperty( final
284285
.kind( ModelingKind.TEMPLATE )
285286
.valueType( mapAASXSDataType( property.getCharacteristic().flatMap( Characteristic::getDataType ).map( this::mapType ).orElse( UNKNOWN_TYPE ) ) ) // TODO this might not work and a proper mapping implementation is required
286287
.displayName( map( property.getPreferredNames() ) )
287-
.value( property.getExampleValue().map( Object::toString ).orElse( UNKNOWN_EXAMPLE ) )
288+
.value( property.getExampleValue().map( i -> i.getValue().toString() ).orElse( UNKNOWN_EXAMPLE ) )
288289
.description( map( property.getDescriptions() ) )
289290
.semanticId( buildReferenceToConceptDescription( property ) ) // this is the link to the conceptDescription containing the details for
290291
// the Characteristic
@@ -486,6 +487,7 @@ public Environment visitCollection(
486487
.displayName( map( property.getPreferredNames() ) )
487488
.description( map( property.getDescriptions() ) )
488489
.value( Collections.singletonList( decideOnMapping( property, context ) ) )
490+
.kind( ModelingKind.TEMPLATE)
489491
.build();
490492

491493
createSubmodelElement( builder, context );
@@ -517,6 +519,7 @@ public Environment visitSet(
517519
.displayName( map( property.getPreferredNames() ) )
518520
.description( map( property.getDescriptions() ) )
519521
.value( Collections.singletonList( decideOnMapping( property, context ) ) )
522+
.kind( ModelingKind.TEMPLATE)
520523
.build();
521524
createSubmodelElement( builder, context );
522525
return context.getEnvironment();
@@ -558,6 +561,7 @@ public Environment visitEither(
558561
.displayName( map( either.getPreferredNames() ) )
559562
.description( map( either.getDescriptions() ) )
560563
.value( submodelElements )
564+
.kind( ModelingKind.TEMPLATE)
561565
.build();
562566
context.setPropertyResult( aasSubModelElementCollection );
563567
return context.environment;

0 commit comments

Comments
 (0)