Symantec IGA

 View Only
  • 1.  Workpoint script to collect user data

    Posted Sep 16, 2015 02:47 PM
      |   view attached

    Hello guys,

     

    I'm trying to implement a send email function in a Workpoint process.

    I've already managed to send an email, but in a hard-coded way.

    I'd like to know if it's possible to get user data (as the email address) from IdM and use it in the Workpoint process. Note that I need the data from the user who initiated the task.

    For example, we already have by default the IM Approvers script that collect information about the approvers. This is the IM Approvers script configuration:

    Java class: com.netegrity.ims.workflowCallbacks.WorkpointRules

    Method: imApprovers

    Parameters: ClientContext,SymbolTable,ThisActivityInstData,ThisJobData

     

    I need to know how to configure a new script that'll collect the user data (mainly the email) from the user who initiated the task, so I can use this script in the email form.

     

    Attached a document that I found showing the steps about how to configure the send email function in Workpoint.

     

    Regards,

    Adami

    Attachment(s)

    doc
    Workpoint Email Setup.doc   214 KB 1 version


  • 2.  Re: Workpoint script to collect user data

    Broadcom Employee
    Posted Sep 30, 2015 03:52 AM

    Here is a proposed solution:

    • Use Agent to gather data from IM and save in Workpoint Job (JOB data) (you can see code snippets below)
      • This will get the task initiator uid
      • Use UserProvider to read this user (from the IM User Store) to get the email
      • Save in JOB DATA
      • Read other data needed on the email from the IM Task
    • Run agent in server-automated NODE
    • Have MAIL action, which will collect data from JOB data (as read by previous agent)
      • And use in MAIL subject or body
      • RECIPIENT: use a RESOURCE script (to pass the email address of the Task INITIATOR)
    • Add this MAIL script to appropriate Node

     

    Code snippets in workpoint agent:

    AGENT script to read data from TASK (use agent in Node)

    ims-id, ime-id = these are set by IM when starting a workflow job – these are used to get IM “WorkflowContext”

    You can get at nearly anything in IM through this context:

    // INIT

    THISSCRIPT="flowLookup";

    showMSGS=false  ;

    pout=java.lang.System.out;

    if (showMSGS) pout.println( THISSCRIPT+" - starting " ) ;

    //Get the IM Task Context

    imsId = ThisJobData.getUserData("ims-id").getVariableValue();

    if (showMSGS) pout.println( THISSCRIPT+" - imsId="+ imsId ) ;

    envOid = ThisJobData.getUserData("ime-id").getVariableValue();

    if (showMSGS) pout.println( THISSCRIPT+" -envOid="+envOid ) ;

    tempWFCB = new Packages.com.netegrity.imapi.WorkflowCallbackHelper() ;

    workflowContext = tempWFCB.generateWorkflowContext(imsId,envOid);

    //

    // Read User

    // *********

    evt= workflowContext.getEvent();

    user = evt.getUser();

    //

    // Read User Data

    // ==============

    // Read Request Data

    // *****************

    tempRqstSCId = "" ;

    tempRqstSCItemId = "" ;

    tempTYPE="R";

    tempPTeam = "" ;

    try { tempRqstSCId = user.getAttribute("|Rqst_SC_RqstId|");} catch (ex) { tempRqstSCId = "" ; }

      if (showMSGS) pout.println(THISSCRIPT+" - tempRqstSCId="+tempRqstSCId ) ;

     

    Set data on JOB (for use in later agent, node)

    ThisJobData.setUserData("IMS.RACF.B4.AC", tempRACFAC) ;

    ThisJobData.setUserData("IMS.RACF.B4.ID", tempRACFID) ;

     

    Read Back from JOB

    tempUserID = ThisJobData.getUserData("IMS.RQST.USERID").getVariableValue();

     

     

    READ a NODE – set data on it

    thisNode = ThisJobData.getActivityByName( “<NAME>” ) ;

    thisNode.setUserData( "APPROVER_FILTER_1_VALUE" , tempMrgID ) ;