Skip to content

Commit

Permalink
feature: #602 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-lcapellino committed Apr 9, 2024
1 parent 2967e4d commit 4fd3ce9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class DecentralRegistryServiceImpl implements DecentralRegistryService {

private static final String DIGITAL_TWIN_TYPE = "digitalTwinType";
private static final String AS_BUILT_DIGITAL_TWIN_TYPE = "PartInstance";
private static final String AS_PLANNED_DIGITAL_TWIN_TYPE = "PartType";

@Override
@Async(value = AssetsAsyncConfig.LOAD_SHELL_DESCRIPTORS_EXECUTOR)
Expand Down Expand Up @@ -80,7 +81,8 @@ private boolean isAsBuilt(AssetAdministrationShellDescriptor shellDescriptor) {
}

private boolean isAsPlanned(AssetAdministrationShellDescriptor shellDescriptor) {
return !isAsBuilt(shellDescriptor);
Optional<IdentifierKeyValuePair> first = shellDescriptor.getSpecificAssetIds().stream().filter(item -> item.getName().equals(DIGITAL_TWIN_TYPE) && item.getValue().equals(AS_PLANNED_DIGITAL_TWIN_TYPE)).findFirst();
return first.isPresent();
}
}

0 comments on commit 4fd3ce9

Please sign in to comment.