Browse Source
Merge pull request #9494 from thingsboard/fix/vc-edge-rule-chain
Version control: fix edgeRuleChainId substitution for asset and device profiles
pull/9515/head
Andrew Shvayka
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
4 additions and
0 deletions
-
application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/AssetProfileExportService.java
-
application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/DeviceProfileExportService.java
-
application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/AssetProfileImportService.java
-
application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/DeviceProfileImportService.java
|
|
|
@ -33,6 +33,7 @@ public class AssetProfileExportService extends BaseEntityExportService<AssetProf |
|
|
|
protected void setRelatedEntities(EntitiesExportCtx<?> ctx, AssetProfile assetProfile, EntityExportData<AssetProfile> exportData) { |
|
|
|
assetProfile.setDefaultDashboardId(getExternalIdOrElseInternal(ctx, assetProfile.getDefaultDashboardId())); |
|
|
|
assetProfile.setDefaultRuleChainId(getExternalIdOrElseInternal(ctx, assetProfile.getDefaultRuleChainId())); |
|
|
|
assetProfile.setDefaultEdgeRuleChainId(getExternalIdOrElseInternal(ctx, assetProfile.getDefaultEdgeRuleChainId())); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@ -33,6 +33,7 @@ public class DeviceProfileExportService extends BaseEntityExportService<DevicePr |
|
|
|
protected void setRelatedEntities(EntitiesExportCtx<?> ctx, DeviceProfile deviceProfile, EntityExportData<DeviceProfile> exportData) { |
|
|
|
deviceProfile.setDefaultDashboardId(getExternalIdOrElseInternal(ctx, deviceProfile.getDefaultDashboardId())); |
|
|
|
deviceProfile.setDefaultRuleChainId(getExternalIdOrElseInternal(ctx, deviceProfile.getDefaultRuleChainId())); |
|
|
|
deviceProfile.setDefaultEdgeRuleChainId(getExternalIdOrElseInternal(ctx, deviceProfile.getDefaultEdgeRuleChainId())); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@ -46,6 +46,7 @@ public class AssetProfileImportService extends BaseEntityImportService<AssetProf |
|
|
|
protected AssetProfile prepare(EntitiesImportCtx ctx, AssetProfile assetProfile, AssetProfile old, EntityExportData<AssetProfile> exportData, IdProvider idProvider) { |
|
|
|
assetProfile.setDefaultRuleChainId(idProvider.getInternalId(assetProfile.getDefaultRuleChainId())); |
|
|
|
assetProfile.setDefaultDashboardId(idProvider.getInternalId(assetProfile.getDefaultDashboardId())); |
|
|
|
assetProfile.setDefaultEdgeRuleChainId(idProvider.getInternalId(assetProfile.getDefaultEdgeRuleChainId())); |
|
|
|
return assetProfile; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +49,7 @@ public class DeviceProfileImportService extends BaseEntityImportService<DevicePr |
|
|
|
@Override |
|
|
|
protected DeviceProfile prepare(EntitiesImportCtx ctx, DeviceProfile deviceProfile, DeviceProfile old, EntityExportData<DeviceProfile> exportData, IdProvider idProvider) { |
|
|
|
deviceProfile.setDefaultRuleChainId(idProvider.getInternalId(deviceProfile.getDefaultRuleChainId())); |
|
|
|
deviceProfile.setDefaultEdgeRuleChainId(idProvider.getInternalId(deviceProfile.getDefaultEdgeRuleChainId())); |
|
|
|
deviceProfile.setDefaultDashboardId(idProvider.getInternalId(deviceProfile.getDefaultDashboardId())); |
|
|
|
deviceProfile.setFirmwareId(getOldEntityField(old, DeviceProfile::getFirmwareId)); |
|
|
|
deviceProfile.setSoftwareId(getOldEntityField(old, DeviceProfile::getSoftwareId)); |
|
|
|
|