Java API - How to get Asset Type scoping information?
Hello,
Is there a way to get scoping information(Communities scoping, categories Scoping) for asset types using java API?
I am aware that we can get attribute constraint data for asset type.
Regards,
Pramod
|
One answer
Hi,
There is a function RAMAssetType.getConfiguration() could be used to retrieve asset type configuration as String. However I am afraid that there is not a out-of-box way(functions) to retrieve the constraints object. One may need to serilize/deserilize via emf resourceSet. Here is one example code: RAMAssetType type = app.getAssetType("Lin Type"); String typeConfigStr = type.getConfiguration(); ResourceSet resourceSet = ManifestAccessor.createResourceSet((RAMURIConverter) null); Resource res = resourceSet.createResource(URI.createURI("testdata.xmi")); try { res.load(new ByteArrayInputStream(typeConfigStr.getBytes("UTF-8")), null); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } AssetTypeConfiguration typeConfig = (AssetTypeConfiguration) res.getContents().get(0); List contraints = typeConfig.getConstraints(); |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Hello,