Previous Topic: taskContextInformationNext Topic: Java Standard Output Stream


Additional Methods

The methods in _taskContextInformation and _eventContextInformation are provided through the ExposedTaskContextInformation and ExposedEventContextInformation, respectively.

These objects inherit methods in the core CA Identity Manager API. Consequently, the inherited methods are also available to _taskContextInformation and _eventContextInformation.

The following methods inherited from the TaskInfo object are particularly useful to an email template:

These retrieved objects allow you to insert administrator-specific and task-specific information into an email. For example:

<!-- Define the E-mail Properties --->

<%
   _cc = "" ;
   _bcc = "" ;
   _subject = _eventContextInformation.getEventName() +
                                              " Approval Request";
%>
<!--- Start of Body --->
<html>
<body text="Navy">

The following item has been added to your work list for approval:<br>
<br>
User <b><%= _eventContextInformation.getAdministrator().
               getAttribute(Packages.com.netegrity.llsdk6.imsapi.
                managedobject.User.PROPERTY_FRIENDLY_NAME)%> </b>
               from department <b><%= _eventContextInformation.
               getAdministrator().getOrg(null).getFriendlyName()
               %></b> initiated task <b><%= _eventContextInformation.
               getAdminTask().getFriendlyName() %></b>at <b><%=                _eventContextInformation.getSessionCreateTime() %></b>
<br><br>
<font color="green">Details: </font><b><%=_eventContextInformation.
                                          getEventName()%></b><br>
<font color="green"><%=_eventContextInformation.
                              getPrimaryObjectTypeName()%>:</font>
<b><%=_eventContextInformation.getPrimaryObjectName()%></b> 
                                                      was modified
<br>
<font color="green">Updated Attributes:</font>
<table border="1">
<tr>
  <td><b>Name</b></td>
  <td><b>Value</b></td>
</tr>
<%
   var event = _eventContextInformation.getEvent();
   if(event instanceof Packages.com.netegrity.imapi.UserEvent) {
      var user = event.getUser();
      var attributes = user.getAttributes().keys();
      while(attributes.hasMoreElements()) {
         var attr = attributes.nextElement();
         var value = user.getAttribute(attr);
         if(user.hasAttributeChanged(attr)) {
            template.add("<tr><td>" + attr +"</td>");
            template.add("<td>" + value +"</td></tr>");
         }
      }
   }
%>
</table>
<br>
</body>
</html>

Possible email body:

Possible email body

For more information about the inherited methods that are available to the Email Template API, see the objects ExposedTaskContextInformation and ExposedEventContextInformation objects in the CA Identity Manager Javadoc.