Relationship mapping from a csv data source

Tagged: ,

This topic contains 9 replies, has 4 voices, and was last updated by  jelikapahwa 1 week, 2 days ago.

  • Author
    Posts
  • #16152
     pervindersingh 
    Participant

    Hi all,
    I am new to OpenIDM and i am working on a task to make employee-manager relationship. The thing here is that data source is a csv file and the manager column contains the username of the manager as follows:

    id username first_name last_name email jobtitle manager
    1 tgardner0 Thomas Gardne tgardner0@nsw.gov.au Software Engineer sadams1

    working in UI, it can be easily done, but what should I do in the object type of connector or the mapping if the details of multiple employee comes in a single csv.

    Please help!!

    #16167
     Jake Feasel 
    Moderator

    Please clarify the exact nature of the problem or question you have.

    #16169
     pervindersingh 
    Participant

    Hi Jake,
    I’m working on a task in which i get employee data in a csv. Firstly, in UI we have an option to directly add manager in user details(just click add manager). But how can I provide the reference to the manager if the user detail is coming from a csv and i want the manager to be reflected in the user detail once i reconcile.

    Csv:
    id username first_name last_name email jobtitle manager
    1 tgardner0 Thomas Gardner tgardner0@nsw.au Software Engineer sadams1
    2 jcole1 Jay Cole jcole1@nsw.au Test Engineer sadams1

    I this i have 2 identities which i want to reconcile and both contain the username of their manager. sadams1 is already present in openIDM. Now i want to know what changes should i make in the connector object type or the mapping so that after i reconcile, manager is reflected in the user details just like it is reflected when we add manager in the UI.

    #16206
     Jake Feasel 
    Moderator

    Take a look at the workflow sample. It does pretty much this exact thing – there is a csv file (or possibly an XML file depending on which version you are looking at) which has one record per user, and a reference to the userName of the manager for those users. You can see in the sync.json how that is mapped.

    #16258
     pervindersingh 
    Participant

    Still haven’t found the workflow sample. But i found a link close to my requirement

    https://wikis.forgerock.org/confluence/display/openidm/Bulk+Import+of+users+with+rolemembership

    the difference is it maps user-role relationship by adding a transformation script. I want a employ this type of tactic(using transformation script) to add manager to user.
    I hope u could help me to with the script part.

    PS: the blog has your name so i hope u could help:)

    #16271
     Jake Feasel 
    Moderator

    Do you have the folder “samples/workflow” in your installation? That’s the workflow sample.

    #16624
     pervindersingh 
    Participant

    Thanks Jake, I found the transformation script required for the manager mapping.

    #22511
     jelikapahwa 
    Participant

    @pervinderpalsingh @pervindersingh – I have same problem like you . Could you share the transformation script used to manager and employee assignment .

    Thanks

    #22513
     pervinderpalsingh 
    Participant

    Here’s the script:

    {‘_ref’: ‘managed/user/’ + openidm.query(‘managed/user’, {‘_queryFilter’: ‘/userName eq \”‘+source+’\”‘}).result[0]._id}

    openidm.query() method will get the _id attribute of the manager by comparing his userName(source) with the existing users.

    _ref parameter is the one that establishes the relation.
    Eg: ‘_ref’ = ‘managed/user/<randomID>’

    #22545
     jelikapahwa 
    Participant

    @pervinderpalsingh Thanks Pervinder, It works now . One more query on a use case-

    I am not able to provision manager attribute in target . I am using openidm.read(source._ref).username in my transformation script.

    In logs couldn’t detect any useful info . However during reconciliation all other attribute are flowing well other than Manager attribute , not sure why .

    I tried sync-with-provisioning workflow sample but couldn’t get any thing relevant to that use case.

    Appreciate if you could help.

    Thank you

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

©2018 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?