It's all about the answers!

Ask a question

class compatibility issue ......


Abhinav Ajmera (22113020) | asked Sep 03 '10, 9:52 a.m.
I am trying to relate some assets programmatically using RAM Client API.

But getting com.ibm.ram.common.data.RelationshipType incompatible with com.ibm.ram.client.RAMRelationshipType Exception.

Getting Exception at thirld line below...

RelationshipType relationShipType = (RAMRelationshipType) new RelationshipType();
relationShipType.setName("Is Used By");
assetToBeRelated.addRelatedAsset(relateToAsset, relationShipType);
session.put(assetToBeRelated, new NullProgressMonitor());

But as per API I am creating RelationshipType object and passing it right way..

problem may look silly, but i have spent lot of time / thru different ways, with no luck.

2 answers



permanent link
Abhinav Ajmera (22113020) | answered Sep 06 '10, 4:34 a.m.
Got it. Thanks.

First you need to create the relationship type in RAM if it does not already exist

RAMRelationshipType newRelationshipType = session.createRelationshipType("Is Used By", "Uses");
session.put(newRelationshipType, new NullProgressMonitor());

Next, you need to add the relationship to the asset

assetToBeRelated.addRelatedAsset(relateToAsset, session.getRelationshipType("Is Used By"));
session.put(assetToBeRelated, new NullProgressMonitor());

See the 'Create a new Relationship Type' and 'Add Related Assets to an Asset' topics at
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r2m0/index.jsp?topic=/com.ibm.ram.doc/topics/t_using_api.html

permanent link
Sheehan Anderson (1.2k4) | answered Sep 03 '10, 10:45 a.m.
JAZZ DEVELOPER
First you need to create the relationship type in RAM if it does not already exist

RAMRelationshipType newRelationshipType = session.createRelationshipType("Is Used By", "Uses");
session.put(newRelationshipType, new NullProgressMonitor());

Next, you need to add the relationship to the asset

assetToBeRelated.addRelatedAsset(relateToAsset, session.getRelationshipType("Is Used By"));
session.put(assetToBeRelated, new NullProgressMonitor());

See the 'Create a new Relationship Type' and 'Add Related Assets to an Asset' topics at
http://publib.boulder.ibm.com/infocenter/ramhelp/v7r2m0/index.jsp?topic=/com.ibm.ram.doc/topics/t_using_api.html

Your answer


Register or to post 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.