Hi all,
My first question is : Will I be able to apply retention policy (individual) on a Document through custom SBO? Because, in this post, https://community.emc.com/message/333166 it is mentioned that Retention policy could be applied through job method only (without any error).
My requirement is to apply retention policy on a custom object type based on the attributes of the document. So, I have developed a SBO for applying retention policy. I have written methods to get the retention policy name that needs to be applied on the document. My retention policy contains a condition and base date will be applied based on the condition.
I am applying the retention policy in the following code:
public void assignRetnPolicy(IDfSysObject objSysObject,
String strPolicyName) throws DfException {
IDfClientX objClientX = new DfClientX();
PolicyParamBean objPolicyParamBean = null;
IPolicyService objPolicyService = null;
IDfClient objClient = null;
IDfSession objSession = null;
IDfSessionManager objSessMngr = null;
IDfSysObject objPolicyObject = null;
IDfId objPolicyId = null;
try {
if (null != strPolicyName
&& !("".equalsIgnoreCase(strPolicyName.trim()))
&& null != objSysObject) {
objClient = objClientX.getLocalClient();
objSession = objSysObject.getObjectSession();
objSessMngr = objSession.getSessionManager();
DfLogger.debug(this, "Setting PolicyParamBean", null, null);
objPolicyParamBean = new PolicyParamBean();
DfLogger.debug(this, "invoking PolicyService module(SBO)", null, null);
objPolicyService = (IPolicyService) objClient.newModule(
objSession.getDocbaseName(), IPolicyService.class
.getName(), objSessMngr);
DfLogger.debug(this, "after invoking PolicyService", null, null);
DfLogger.debug(this, "strPolicyName:::" + strPolicyName, null, null);
objPolicyObject = (IDfSysObject) objSession
.getObjectByQualification("dmc_rps_retention_policy where object_name ='"
+ strPolicyName.trim() + "'");
objPolicyId = objPolicyObject.getObjectId();
DfLogger.debug(this, "setting policy id to policyparambean", null, null);
objPolicyParamBean.setPolicyId(objPolicyId);
DfLogger.debug(this, "applying retention policy" + strPolicyName, null, null);
objPolicyService.apply((IDfSysObject)objSysObject, objPolicyParamBean);
DfLogger.debug(this, "end", null, null);
} else
throw new DfException(
"Error Occured : Either policy name or sysobject is null");
} catch (Exception objExp) {
throw new DfException(objExp);
}
In this code, I am getting the error at this line
objPolicyService.apply((IDfSysObject)objSysObject, objPolicyParamBean);
And in the logs, I am getting teh following error/exception message.
2010-11-17 06:03:18,749 DEBUG HonRetTask [Thread-583]
DfException:: THREAD: Thread-583; MSG: ; ERRORCODE: ff; NEXT: null
at com.abcd.dctm.sbo.hontasks.HonRetTask.assignRetnPolicy(HonRetTask.java:252)
at com.abcd.dctm.sbo.hontasks.HonRetTask.execute(HonRetTask.java:103)
at com.abcd.dctm.sbo.eventmanagement.EventManager.doEvent(EventManager.java:263)
at com.abcd.dctm.tbo.HONBusinessObject.executeEvent(HONBusinessObject.java:134)
at com.abcd.dctm.tbo.HONBusinessObject.doSave(HONBusinessObject.java:107)
at com.documentum.fc.client.DfPersistentObject.saveEx(DfPersistentObject.java:899)
at com.documentum.fc.client.DfPersistentObject.save(DfPersistentObject.java:894)
at com.abcd.dctm.hr_tbo.HONHREmpRecBusinessObject___PROXY.save(HONHREmpRecBusinessObject___PROXY.java)
at com.documentum.operations.nodeactions.inbound.DfCheckinObject.checkin(DfCheckinObject.java:235)
at com.documentum.operations.nodeactions.inbound.DfCheckinObject.execute(DfCheckinObject.java:39)
at com.documentum.operations.steps.impl.OperationStep.executeStep(OperationStep.java:151)
at com.documentum.operations.steps.impl.OperationStep.execute(OperationStep.java:40)
at com.documentum.operations.impl.OperationExecutionEngine.execute(OperationExecutionEngine.java:51)
at com.documentum.operations.DfOperation.execute(DfOperation.java:342)
at com.documentum.operations.inbound.impl.InboundOperation.execute(InboundOperation.java:104)
at com.documentum.operations.inbound.DfImportOperation.execute(DfImportOperation.java:96)
at com.documentum.web.contentxfer.DFCOperationSupport.execute(DFCOperationSupport.java:61)
at com.documentum.web.contentxfer.ContentTransferService.execute(ContentTransferService.java:377)
at com.documentum.web.contentxfer.JobAdapter.execute(JobAdapter.java:108)
at com.documentum.job.async.AsyncJobManager$AsyncTimerJob.executeJob(AsyncJobManager.java:236)
at com.documentum.job.async.AsyncJobManager$AsyncTimerJob.run(AsyncJobManager.java:215)
at java.util.Timer$TimerImpl.run(Timer.java:291)
Caused by:
java.lang.ClassCastException: com.abcd.dctm.hr_tbo.HONHREmpRecBusinessObject___PROXY incompatible with com.documentum.rpm.policyengine.aspect.IPolicyCoordinator
at com.documentum.rps.retention.BaseRetentionOperations.applyObjectBasedRetention(BaseRetentionOperations.java:276)
at com.documentum.rpm.services.RpmRetentionService$PrivilegedApplyObjectBasedRetention.run(RpmRetentionService.java:317)
at com.documentum.fc.client.security.DfPrivilegedExceptionActionInRole.run(DfPrivilegedExceptionActionInRole.java:106)
at java.security.AccessController.doPrivileged(AccessController.java:251)
at com.documentum.rpm.services.RpmRetentionService.applyRetention(RpmRetentionService.java:238)
at com.documentum.rpm.policyengine.services.PolicyService.apply(PolicyService.java:1282)
at com.abcd.dctm.sbo.hontasks.HonRetTask.assignRetnPolicy(HonRetTask.java:245)
... 21 more
HONHREmpRecBusinessObject is the TBO implementation class for my custom object type. I have no clue why I am getting classcastexception here. Experts, kindly help me in this regard.
TIA,
Shiv