Topic
  • 5 replies
  • Latest Post - ‏2014-02-28T08:59:41Z by franzw
AdapterDeveloper
AdapterDeveloper
36 Posts

Pinned topic Requester ID in workflow

‏2014-02-08T04:32:53Z |

Hi 

I have a requirement in my workflow that I have to collect requester user id in this workflow.

I can get requester name using process method but what about requester user id? Is there and method to get requester id?

 

Thanks

  • chrisc
    chrisc
    8 Posts

    Re: Requester ID in workflow

    ‏2014-02-08T22:06:18Z  

    If the requester is a user (not a system process) then you can use "process.requesterDN" to get the DN of the Person object. You can then use AccountSearch.searchByOwner to get the list of accounts owned by that Person. Just look for the ITIM account in that list. 

    You can do some optimization here if your identity policy dictates using an unique attribute in the Person object for user IDs, .e.g employee number. In that case, you don't need to search for accounts just return the unique attribute from the Person object.

    P.S: I'm not sure which version of SIM introduced process.requesterDN for JavaScript extension. I know 6.0 definitely has it. If it's not available in your version of TIM you might have to write a workflow extension for it since I'm sure it's available in Java API for all versions.

  • HarishAyengar
    HarishAyengar
    2 Posts

    Re: Requester ID in workflow

    ‏2014-02-24T07:39:57Z  
    • chrisc
    • ‏2014-02-08T22:06:18Z

    If the requester is a user (not a system process) then you can use "process.requesterDN" to get the DN of the Person object. You can then use AccountSearch.searchByOwner to get the list of accounts owned by that Person. Just look for the ITIM account in that list. 

    You can do some optimization here if your identity policy dictates using an unique attribute in the Person object for user IDs, .e.g employee number. In that case, you don't need to search for accounts just return the unique attribute from the Person object.

    P.S: I'm not sure which version of SIM introduced process.requesterDN for JavaScript extension. I know 6.0 definitely has it. If it's not available in your version of TIM you might have to write a workflow extension for it since I'm sure it's available in Java API for all versions.

    is process.requesterDN supported in ITIM 5.1? and is there any other way to fetch requesterDN basically I want to fetch roles of requester?

  • Buzzcut
    Buzzcut
    10 Posts

    Re: Requester ID in workflow

    ‏2014-02-25T13:41:26Z  

    is process.requesterDN supported in ITIM 5.1? and is there any other way to fetch requesterDN basically I want to fetch roles of requester?

    It looks as though it might just be undocumented in ITIM 5.1:

    http://www-01.ibm.com/support/docview.wss?uid=swg1IZ82934

    You could do something like:

    var requestor = new Person(process.requestorDN);

    var requestorRoles = requestor.getRoles();

    for (var i = 0; i < requestorRoles.length; i++) {

      // do something with requestorRoles[i].getProperty("errolename")[0] or any other attributes of the role

    }

  • HarishAyengar
    HarishAyengar
    2 Posts

    Re: Requester ID in workflow

    ‏2014-02-25T14:24:25Z  
    • Buzzcut
    • ‏2014-02-25T13:41:26Z

    It looks as though it might just be undocumented in ITIM 5.1:

    http://www-01.ibm.com/support/docview.wss?uid=swg1IZ82934

    You could do something like:

    var requestor = new Person(process.requestorDN);

    var requestorRoles = requestor.getRoles();

    for (var i = 0; i < requestorRoles.length; i++) {

      // do something with requestorRoles[i].getProperty("errolename")[0] or any other attributes of the role

    }

    Thanks it worked :)

  • franzw
    franzw
    395 Posts

    Re: Requester ID in workflow

    ‏2014-02-28T08:59:41Z  
    • Buzzcut
    • ‏2014-02-25T13:41:26Z

    It looks as though it might just be undocumented in ITIM 5.1:

    http://www-01.ibm.com/support/docview.wss?uid=swg1IZ82934

    You could do something like:

    var requestor = new Person(process.requestorDN);

    var requestorRoles = requestor.getRoles();

    for (var i = 0; i < requestorRoles.length; i++) {

      // do something with requestorRoles[i].getProperty("errolename")[0] or any other attributes of the role

    }

    Yes - it dissapeared between 4.5.1 (you can find it there) and 5.0 - This was corrected by a PMR that I wrote as I use it all times as it needed to get the unique requestor.

    I do not know why we (IBM) delivers a getRootRequesterName that is basically useless for any other purposes in reporting/mails as cn is not a unique attribute - I hope we will add getRootRequestorDN sometime in the future...

    Regards

    Franz Wolfhagen