Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

2 Step Approval Workflow

$
0
0

Hi gurus,

 

I have been task to design a 2 step approval workflow that searches for 2 approval agents on the collaborators tab from the master agreement but my approvers are not receiving anything in their inboxes.

 

Thanks in advance for your response.

Please advise if there is no other way to do this development.

Below is my code:

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

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

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

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

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

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

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

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

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

 

logMsg = Logger.createLogMessage(session);

logMsg.setLogMessage("[ContractApprovalWF -Lease_Approver1]");

Logger.info(logMsg);

 

    home = doc.getIBeanHomeIfc();

    ObjectReferenceIfc principal; 

 

// find approver from collaborators

//    CollabRoleHome = IBeanHomeLocator.lookup(session,CollaboratorRoleIBeanHomeIfc.sHOME_NAME);               

//    approverRole = CollabRoleHome.findUniqueByName("SANBS Legal Representative");

//      approverRole = CollabRoleHome.findUniqueByName("SANBS Executive");

//    parentDoc = doc.getParentIBean();

//    collabCollection = parentDoc.getCollaborators();

//    done = false;

//  for(int i = 0; i < collabCollection.size() && done == false; i++ ){

//     collaborator = collabCollection.get(i);

//    if(collaborator.getCollaboratorRole().equals(approverRole.getObjectReference())){

//        principal = collaborator.getPrincipal();

//        done = true;

//     }

// } 

 

//get approver from extesion

principal = doc.getExtensionField("SANBS Lease Approver1").get();

// If an approver was established based on the logic then add them as an approver now.

if (hasValue(principal))

{

    addApprover(principal);

}

else

{

    cancelProcess("Invalid Lease Approver");

}

 

Regards,


Viewing all articles
Browse latest Browse all 3184

Trending Articles