Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-03-31T16:59:50Z by SystemAdmin
SystemAdmin
SystemAdmin
9855 Posts
ACCEPTED ANSWER

Pinned topic Getting all ITIMPerson Attributes that are Requested to be Modified.

‏2013-03-30T11:09:45Z |
Hello,

I need to know if there is any java extension that can be called within a workflow to capture the all attributes of an ITIMPerson that have been requested to be modified. We are implementing an approval workflow on specific attributes rather than the entire profile e.g. on "mobile" modifications, there should be an approval workflow but on "officephonenumber" changes, no approval required.

Best regards,
Updated on 2013-03-31T16:59:50Z at 2013-03-31T16:59:50Z by SystemAdmin
  • HomerJSimpson
    HomerJSimpson
    157 Posts
    ACCEPTED ANSWER

    Re: Getting all ITIMPerson Attributes that are Requested to be Modified.

    ‏2013-03-30T19:28:28Z  in response to SystemAdmin
    Since you want to call this from workflow (and determine path based on changes) I assume you're looking for a JavaScript extension (not a Java extension), correct?

    Take a look at the .getChanges() method (and resulting Changes parameters (attr, op, and values):
    http://pic.dhe.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.isim.doc_6.0/reference/ref/ref_ic_javext_dirobj_chgs.htm

    This should give you what you're looking for.
  • TiborB
    TiborB
    19 Posts
    ACCEPTED ANSWER

    Re: Getting all ITIMPerson Attributes that are Requested to be Modified.

    ‏2013-03-30T23:30:45Z  in response to SystemAdmin
    Hello,

    If I understand you correctly, you are looking for a way in a person modify workflow to tell, which changes to which attributes are requested. The snippet below is a tutorial type of example for how to get and process the attribute changes, compose a string representing the changes and then store the result as an audit record on the process. Just add it to your start node.
    
    function printChanges(o) 
    { var changes = o.getChanges(), i = 0, j = 0, buf = 
    "changes:\n", c = null, p = 
    ''; 
    
    for (; i < changes.length; i++) 
    { c = changes[i]; buf += c.attr + 
    ':'; 
    
    switch (c.op) 
    { 
    
    case 1: p = 
    '+'; 
    
    break; 
    
    case 2: p = 
    '='; 
    
    break; 
    
    case 3: p = 
    '-'; 
    
    break; 
    
    default: p = 
    '~'; 
    } 
    
    for (j = 0; j < c.values.length; j++) 
    { buf += 
    ' ' + p + c.values[j]; 
    } buf += 
    '\n'; 
    } 
    
    return buf; 
    }   process.auditEvent(printChanges(Entity.get()));
    


    The important part, getChanges, is documented here:
    http://pic.dhe.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.itim.doc/ref/ref_ic_javext_dirobj_chgs.html
    http://pic.dhe.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.itim.doc/ref/ref_ic_javext_attribchg_op.html

    Hope this helps.
       T
    • SystemAdmin
      SystemAdmin
      9855 Posts
      ACCEPTED ANSWER

      Re: Getting all ITIMPerson Attributes that are Requested to be Modified.

      ‏2013-03-31T16:59:50Z  in response to TiborB
      Hello HomerJSimpson and TiborB,

      Thanks a lot for your help. ".getChanges()" Java Extension was very helpful. And specially the code shared by Mr. TiborB gave me a very good idea to proceed with my work.

      Best regards,