Skip to Content
avatar image
Former Member

Leavers and joiners policy ideas?

Hi,

I'm looking for slick ideas around managing a leavers and joiners policy so that if John Smith leaves I can replace him across all Projects, Contracts and RFx with Fred Bloggs. The key here is ensuring the audits remain in place so that we can track who actually makes the changes.

I've tried several tests but can't find a way that updates all records with the new details. Maybe I'm missing something.

The only other route is to export all records, replace the Owner or collaborator names and reload. But this is quite a task once a week for 1000 active users.

Ideas, solutions appreciated.

J

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 07, 2010 at 12:35 PM

    Hi Jethro - Following up on my previous reply, below is the script I developed for my prototype.

    Regards,

    Rob

    
    // This script will update the owner of the business document
    // where the current owner is the "from owner"
    import com.sap.eso.api.projects.*;
    
    fromOwner = doc.getExtensionField("FROM_USER").get();
    toOwner = doc.getExtensionField("TO_USER").get();
    
    // Find the projects for the from owner
    projHome = IBeanHomeLocator.lookup(session, ProjectIBeanHomeIfc.sHOME_NAME);
    projList = projHome.findWhere("DOC_OWNER_USER_OBJECT_ID = " + fromOwner.getObjectId().toString());
    
    // Get the audit messages collection
    auditMsgs = doc.getExtensionCollection("AUDIT_MSGS");
    
    // Indicate how many projects were found
    auditMsg = auditMsgs.create();
    auditMsg.set("AUDIT_MSG", "Found " + projList.size() + " projects to update");
    auditMsgs.add(auditMsg);
    
    // Iterate over the projects and change the owner
    if (projList != null)
    {
        iter = projList.iterator();
        while (iter.hasNext())
        {
            // Work with the bean now
            projBean = iter.next();
            projHome.upgradeToEdit(projBean);
    
            // Now change the owner
            projBean.setDocumentOwnerUserReference(toOwner);
    
            // Finally, save
            projHome.save(projBean);
    
            // Add an audit message
            auditMsg = auditMsgs.create();
            auditMsg.set("AUDIT_MSG", "Updated project " + projBean.getDocumentId());
            auditMsgs.add(auditMsg);
        }
    }
    
    // Add logic below for additional object types (e.g., RFx, Auction, Master Agreements).
    

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Rob,

      thanks. That's something I haven't thought of but it sounds like a great solution. It is indeed to bad that it will only affact the new workflows and not the existing ones but still...

  • avatar image
    Former Member
    Sep 07, 2010 at 12:33 PM

    Hi Jethro -

    As you have indicated in your post, the out-of-the-box solution provided with E-Sourcing requires use of import files to change the ownership of business documents. This works, but can be labor intensive for frequent changes. As a result, I investigated using the extensibility features of E-Sourcing to provide an easier to use option. I will explain in this reply the basic approach and provide some of the script definition beanshell code I used in a prototype that I prepared.

    The concept that I used for my prototype involves the configuration of a "owner change" object which has fields for the "from user", the "to user", and an audit trail. When it is time to handle a "leaver", a new owner change object would be created which identifies the from/to users and an action is taken to change any Projects, RFx, Auctions, or Master Agreements to have the "to user" as the owner wherever the "from user" is currently the owner. In addition, I included a short audit log in the owner change object that lists all of the objects that were changed. In addition to the audit log provided by the owner change object, a "change history" record is created with the business document update. That message appears as:

    This document's owner changed to: Robert Stevenson

    For my prototype, I utilized the User Defined MasterData 1 object, added extensions to it for the from/to users, and configured the user interface using page customizations. I included the beanshell script as a toolbar action on the object.

    Upon completion of the prototype, I did think of an additional enhancement where the owner change object would also include checkboxes to indicate which objects should be updated (projects, rfx, auction, and contracts).

    I think the approach outlined is a good one in that the process is controlled by a single object accessed from setup and the details are logged for audit purposes. The use of extension definitions and scripting is not extensive due to the convenient IAPIs provided with E-Sourcing.

    NOTE: Due to issues with large posts in the SDN, I will post the sample code in the next reply.

    I hope this reply is useful.

    Regards,

    Rob

    Add comment
    10|10000 characters needed characters exceeded