Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

class compatibility issue ......

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.

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 03 '10, 9:52 a.m.

Question was seen: 5,165 times

Last updated: Sep 03 '10, 9:52 a.m.

Confirmation Cancel Confirm