0

I am facing a issue where I am not able to get the document information associated with the record. The line below is used to get a particular record,

com.ibm.jarm.api.core.Record r = RMFactory.Record.fetchInstance(jarmFPOS, "{AE10E0F1-323F-4445-A529-78F744E8D3E4}", null);

Now that I have a record object I need to fetch the document information such as DocId, DocTitle, DocOwner etc..I know that the required information is stored in a property called as “RecordedDocuments” or we can use RMProperty.DOCUMENT_LINK from which we can get the value. I am using something like below.

Object obj3 = (Object) r.getProperties().get(RMProperty.DOCUMENT_LINK).getObjectValue();

My issue is here. I am not able to get the values from the Object. I tried typecasting it to a document object but no luck. I keep on getting typecasting error. Can anyone please help me how to get the desired output.

Thanks.

user1194310
  • 129
  • 1
  • 4
  • 14

2 Answers2

0

The Link object would not be a document directly... I'm not very familiar with RM APIs, more with CE APIs, but it would probably be an implementation of the RMLink interface.

What I usually do in such a case is print out the java class name of the object (obj3.getClass().getName()) and that would give you a good indication on which API object you can use.

polonoko
  • 90
  • 9
0

May be because it was a list and not a Document that fails the casting? Try what polonoko told you and print the className.

Or try this code :)

List<com.filenet.api.core.Document> doc = (List<com.filenet.api.core.Document>) r.getProperties().get(RMProperty.DOCUMENT_LINK).getObjectValue();
icrovett
  • 435
  • 7
  • 21