Declaring formal records using code

Gsk7Gsk7 Gautam Kamath
edited May 17, 2011 in Documentum Developer Forum

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 fileplan

fb.setUnlinkSource(false);

fb.setFormTemplateId(formTemplateId);

//create formal record shell

IDfId fId = frs.createFormalRecordShell(fb);

This code gives a runtime exception(Null pointer exception) at last line i.e while creating the formal record shell

The error is as follows:

Exception in thread "main"

java.lang.NullPointerException

at 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 advance

Gautam

Comments

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

Sign In or Register to comment.