Monday, August 1, 2016

Using TDI/SDI to populate Profile Tags in IBM Connections 5.

I have created this simple AssemblyLine to automatically populate tags on profiles in IBM Connections.

This one works in IBM Connections 5.0, but haven´t tested it on version 5.5 yet.

The AL does the following:

  1. The iterator is a CSV file, with the following structure:

    email-address;tag


    For example:

    robert.farstad@item.no;tdideveloper

    robert.farstad@item.no;NominateThisGuyForChampion

    The location of the CSV file is:

    /opt/IBM/TDI/tdisol/tags_input.csv
  2. A JDBC connector in Lookup mode, which connects to the PEOPLEDB table named EMPINST.EMPLOYEE.

    The Link Criteria is the mailaddress from the CSV file. If this one matches with the PROF_EMAIL_LOWER field in the SQL Table, one work attribute is fetched from the table.
    This is the PROF_KEY attribute.
  3. Then a TAG_ID is generated using this random UUID4 script:
    https://gist.github.com/kaizhu256/4482069
  4. Then I write 4 fields into the EMPINST.PEOPLE_TAG table in the PEOPLEDB database.

    -PROF_SOURCE_KEY (this is normally the prof_key value of the user who tags)
    -PROF_TARGET_KEY (the prof_key value of the person beeing tagged)
    -PROF_TAG_ID (the value generated in step 3 above)
    -PROF_TAG (the tag-value itself, from the CSV file)
There are 2 other fields, which are disabled in the "write_entry" connector. The fields are "PROF_TYPE" and "TENANT_KEY".
Those two fields auto-populate in the DB. This means that the AL does not have to worry about them.

This AL is easy to customize to fit your needs. Switch out the iterator with an ldap connector, perhaps? :-)

Screenshots:

Here´s the iterator:






Here´s the side-lookup I do into the EMPLOYEE table, to fetch the PROF_KEY value:




IF branch that checks if the PROF_KEY actually was fetched:


Script where I generate the UUID4 value for the PROF_TAG_ID field:


Here´s the JDBC Connector that writes the tag to the profile.
The author of the tag is the user itself, which means that when TDI writes this tag, it says that I, myself created the tag. That´s where the field "PROF_SOURCE_KEY" and "PROF_TARGET_KEY" comes into play. The value of the fields are equal.

As you can see, the connector is in "AddOnly" mode, and not in "Update" mode. I tested it, and running the same AL on the same csv file, where all the same tags are attempted inserted once more, only produces a small error message. I had no interest in running it in "Update" mode, checking to see if the tag already exists, and tagged by the user itself. This way the user gets a tag, by him- /herself, only.



Before running the Assembly line:


After running the AL:


The Assembly Line can be downloaded here:
https://github.com/rockbert77/connections_tdi/tree/master/Load_Profile_Tags_from_csv_into_Profiles
Import it into your Connections tdisol project and test it out :-)

Hope this was useful to you, and yes, keep me in mind when the IBM Champions nomination is due :-D



No comments: