Declaring formal records using code

Gsk7
edited May 17, 2011 in Documentum #1

Hi,

I want to declare an electronic record as formal record using code..The code consists of the following:

FormalRecordBean fb =new FormalRecordBean();

List templateIdList=(new XFormsUtils()).lookupXFormsTemplateList(session, "dmc_rm_formal_record");

IDfId formTemplateId =new DfId(templateIdList.get(0).toString()); fb.setName("record1"); fb.setFilePlanPath("");  //consists the path given in the fileplanfb.setUnlinkSource(false); fb.setFormTemplateId(formTemplateId);//create formal record shellIDfId fId = frs.createFormalRecordShell(fb);This code gives a runtime exception(Null pointer exception) at last line i.e while creating the formal record shellThe error is as follows:Exception in thread "main"java.lang.NullPointerExceptionat com.documentum.records.util.RecordUtil.isAspectAttached(RecordUtil.java:32)at com.documentum.records.util.RecordUtil.isPolicyManaged(RecordUtil.java:149)at com.documentum.rm.formal.FormalRecordService.meetsPolicyManagedRequirement(FormalRecordService.java:712)at com.documentum.rm.formal.FormalRecordService.canDeclareFormalRecordInFolder(FormalRecordService.java:685)at com.documentum.rm.formal.FormalRecordService.canDeclareFormalRecord(FormalRecordService.java:241)at com.documentum.rm.formal.FormalRecordService.createFormalRecordShell(FormalRecordService.java:265)at RecordsDeclare.declareRecords(RecordsDeclare.java:86)at RecordsDeclare.main(RecordsDeclare.java:34)Can anybody provide me the solution to this problem. Thanks in advanceGautam

Comments

  • am also facing same issue, it would be great if you could provide if this issue has been resolved.