Skip to Content
0
Former Member
Nov 08, 2012 at 02:41 PM

Workflow prescript getting approver from UDO1 document type

25 Views

Hi All,

I am implementing a workflow on UDO1 that is going to get an approval group from an extension on the UDO1 type called approver_1.

I am using the following prescript but keep getting the error A reflection error occurred accessing the object.

import com.sap.odp.api.doccommon.userdefined .*;

import com.sap.odp.api.common.exception.*;

import com.sap.odp.api.common.log.Logger;

import com.sap.odp.api.common.platform.*;

import com.sap.odp.api.common.types.*;

import com.sap.odp.api.doc.collaboration.*;

import com.sap.odp.api.ibean.*;

import com.sap.odp.api.util.*;

import com.sap.odp.api.workflow.*;

import com.sap.eso.api.projects.*;

import com.sap.eso.api.doccommon.masterdata.*;

import com.sap.odp.api.doccommon.masterdata.*;

import com.sap.odp.api.common.log.*;

import com.sap.odp.api.usermgmt.masterdata.*;

import com.sap.odp.api.doc.collaboration.*;

level1ApproverExtName = "approver_1";

logMsg = Logger.createLogMessage(session);

typeHome = IBeanHomeLocator.lookup(session, doc.getDocTypeReference());

typeBean = typeHome.find(doc.getDocTypeReference());

principal = typeBean.getExtensionField(level1ApproverExtName).get();

if (hasValue(principal))

{

// Add the user account as the approver

addApprover(principal,new CollaboratorApprovalRuleType(0));

// log details

logMsg.setLogMessage("Added user: " + principal.getDisplayName() + " as approver");

Logger.info(logMsg);

}

Does anyone know what might be causing this issue?

Many thanks

Dan