Symantec IGA

 View Only
Expand all | Collapse all

Collecting user Data in Workpoint

  • 1.  Collecting user Data in Workpoint

    Posted Sep 09, 2016 04:10 AM

    Hi All,

    We are need to design workflows as per our Business logic which requires the User's information to be passed in workpoint at run time.  Is it possible to get user data (e.g.  manager attribute value ) from IDM and use it in the Workpoint process. Note that we need the data from the user for whom the task has been initiated.

     

    THANKS,

    Vasu



  • 2.  Re: Collecting user Data in Workpoint
    Best Answer

    Posted Sep 09, 2016 06:24 AM

    The only way we've found to implement this - using custom workpoint process agent scripts/emails with scripts/custom resource scripts. We've coded to get user attributes and IM task data (from session attributes) into "User Data" elements in WP. This way we could use that data later on in WP processes.

    This is difficult to implement since CA does not provide the API used to integrate IM with WP. We've decompiled the standard CA code to figure out how this works.

    This blog: CA Identity Manager IdentityMinder Book Tutorial has some good examples on how to implement advanced workflow (the best content is in the books)



  • 3.  Re: Collecting user Data in Workpoint

    Posted Sep 09, 2016 06:46 AM

    As per our requirement, if the User's manager is changed, a 2 level workflow should be triggered , first approval should be the old manager and the second approval should be the new manager.

     

    Thanks,

    Vasu



  • 4.  Re: Collecting user Data in Workpoint

    Posted Sep 09, 2016 08:48 AM

    If I understand correctly your use case - you have a task where a user's manager gets changed. This task needs to be approved by both the old and new managers. In that case you will probably need a dynamic resolver for at least the original manager since he gets overwritten in the task. The task should have 2 approvers. The WP process could have a server automated step that checks if the manager has changed and move to a single approval/multi approval node if needed.



  • 5.  Re: Collecting user Data in Workpoint

    Posted Sep 12, 2016 05:29 AM

    Did tried the Dynamic resolver, but it get's only new manager details not the old manager's.

     

    Thanks,

    Vasu



  • 6.  Re: Collecting user Data in Workpoint

    Posted Sep 12, 2016 05:58 AM

    Sorry, I had the "Custom" resolver in mind but instead I've written dynamic resolver. You need to code a custom resolver that would get the original attribute value (getLastCommittedAttribute). You can also create a new attribute in the user store (e.g. "oldmanager"). Create a BLTH or PX that would copy the original manager to this attribute during task set subject/initialization stage. Then you can use the dynamic resolver and take the old manager from this attribute. WF process should compare the updated manager and old manager and if they differ then move to WF process where both managers need to approve the task.



  • 7.  Re: Collecting user Data in Workpoint

    Posted Sep 12, 2016 07:07 AM

    The getLastCommittedAttribute  drived from Interface AttributeCollection , any idea how can we pass the data into this for from participant resolver Api ?

     

    Thanks,

    Vasu



  • 8.  Re: Collecting user Data in Workpoint

    Posted Sep 12, 2016 08:57 AM

    You can use userProvider to find the user using the participant resolver context.

    String uid = ParticipantResolverContext.getSubject().getFriendlyName() <-- this should give you the userid of the user being modified (currently I don't have the means to verify this code)

    User user = ParticipantResolverContext.getUserProvider().findUser(uid, null)

    String oldmanager = user.getLastCommittedAttribute("manager")



  • 9.  Re: Collecting user Data in Workpoint

    Posted Sep 13, 2016 03:57 AM

    I tired this, but getting error system logs. 

     

     

    InvocationTargetException caught when executing Java class. Command = '#Mon Apr 28 00:41:46 EDT 2003 Parameter4=ThisJobData Parameter3=ThisActivityInstData Parameter2=SymbolTable Parameter1=ClientContext Method=imApprovers JavaClass=com.netegrity.ims.workflowCallbacks.WorkpointRules '; nested exception is: java.lang.ClassCastException: java.lang.String cannot be cast to com.netegrity.llsdk6.imsapi.managedobject.User Error occurred in Statement #1 in Script ID 5:IMOB, Script Name = 'IM Approvers', Script type = 'Resource Select'. Job ID = 126:WPDS, Process Ref = 'IM_160', Node Name = 'Business Approval'



  • 10.  Re: Collecting user Data in Workpoint

    Posted Sep 13, 2016 04:21 AM

    This is just my guess since I don't know your code but it might be that you are returning just the manager ID from your participant resolver. When you have the manager ID you should use the provider accessor to find the manager user object and return it.

    User oldmanageruser = ParticipantResolverContext.getUserProvider().findUser(oldmanager, null)

    You might also need to return a vector of users (I do not know which is needed but from your error - just returning the user should work):

    Vector<User> approvers = new Vector<User>()

    approvers.add(oldmanageruser)



  • 11.  Re: Collecting user Data in Workpoint

    Posted Sep 13, 2016 05:44 AM

    Figured out the issue, the return type was mismatch.  Workflow is able to resolve both the new and old manager .

     

    Thanks,

    Vasu



  • 12.  Re: Collecting user Data in Workpoint

    Posted Sep 13, 2016 06:28 AM

    Can we put a condition such that if User's manager is changed, that only the workflow should be triggered  ?



  • 13.  Re: Collecting user Data in Workpoint

    Posted Sep 19, 2016 10:37 AM

    The only way I could think of to implementing this is by inserting a server automated step at the beginning of the workflow. This step should contain a custom agent that checks if the manager was changed (or it could get this info from the task - set by a blth in a session attribute). It should set the result into the activity user data element (e.g. MANGER_CHANGED="true"/"false") and complete this activity. Then you'd need two transition processes: one for "true" condition that has both managers in the path; the other for when the manager was not changed.

    If anyone knows a way to implement this more efficiently I'd be interested to know. Because if you need anything more complicated than the one check at the beginning of the workflow you get a spiderweb of server automated checks if say there are two different approvers for different roles the user can select in a role request task.



  • 14.  Re: Collecting user Data in Workpoint

    Posted Sep 20, 2016 02:44 AM

    Is there any link/URL which can provide help in creating custom agent for work flow



  • 15.  Re: Collecting user Data in Workpoint

    Posted Sep 26, 2016 06:43 AM

    The only examples I am aware of are - samples provided by CA (IAM Suite\Identity Manager\tools\samples\WorkflowContext). There is a sample ApprovalDecision that changes WF flow based on a user's attribute value.

    Then there is a book from a blogspot blog:

    CA Identity Manager IdentityMinder Book Tutorial: Chapter 4: Workflow and integration 



  • 16.  RE: Re: Collecting user Data in Workpoint

    Posted Nov 28, 2019 02:20 AM
    Hi,
    Could you please share code to get approver's attribute date from IM in workpoint? Thanks!


  • 17.  Re: Collecting user Data in Workpoint

    Broadcom Employee
    Posted Sep 13, 2016 04:59 AM

    Can you plz share the code or copy-paste the code snippet here?

     

     

    Thank you,

     

    Best regards,

    Sumeet