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 ) ;