A

Monday, February 21st, 2022 5:32 PM

Unable to import Codesets - Springboot

I’m trying to import a few code sets/LOVs but the import call does not actually import them. The same import call is successfully importing other Collibra assets such as Schema/Table/Column, etc.

Any pointers will be appreciated.

List<CollibraAsset> LOVAssetCollection= new ArrayList<>();
for(LOV lov: DataModel.getLOVs()){
       lovAssetBuilder = new CollibraAsset.Builder()
                              .name(lov.getLOVId())
                              .typeId("00000000-0000-0000-0000-000000021002")
                              .type(CollibraConstants.AssetType.CODE_SET)
                              .domainId(appConfig.getCollibraLOVDomainId());
       LOVAssetCollection.add(lovAssetBuilder.build());
}
collibraImportApiHelper.importAssets(uuid,
          LOVAssetCollection, CollibraImportResponseType.ASSETS_AND_IDS);

368 Messages

3 years ago

Hello Aaman,

Regarding the error you are encountering when importing assets having type Code Sets, can you please provide the error message/stack trace/more information where the code is failing?

Additionally, just to note that when defining the asset type, only one type definition should be used. As an example, if .type(CollibraConstants.AssetType.CODE_SET) is defined, then .typeId("00000000-0000-0000-0000-000000021002”) is not required.

Thank you

26 Messages

3 years ago

There is no error message, the CodeSets just fail to be imported.

I have tried with both options (.type and .typeId) separately, and am unable to see the import of these assets.

368 Messages

3 years ago

Hello Aaman,

Thanks for the update.

Since it could be that the asset was created in a different domain, can you please try running the integration in debug mode and check which domain ID is being used here?

.domainId(appConfig.getCollibraLOVDomainId());

Afterwards, using the following URL, replace <instance> with your Collibra instance sub-domain and <domain-id> with the value obtained from the previous step ^

https://<instance>.collibra.com/domain/<domain-id>

Finally, can you please check whether the asset exists in this domain? Thank you

26 Messages

Thank you for that pointer - the Domain ID was correct, but while debugging, I discovered, I was missing a critical line of code:

DataModelAsset.add(LOVAssetCollection);

The import call is actually a collection of other assets, so it is called:

collibraImportApiHelper.importAssets(uuid,
                        DataModelAsset,
                        CollibraImportResponseType.COUNTS);

I had missed adding the Codeset collection to this parent collection.

Thank you for your inputs.

Loading...