Custom tasks can be a powerful way to extend Sailpoint’s functionality to perform certain actions that the Out Of The Box (OOTB) solution doesn’t support. As a Sailpoint developer, you’re likely to run into certain client requirements for reporting and certifications which cannot be achieved using default tasks or OOTB configurations.
Recently, I had to create a custom task to export audit reports in CEF format (for HP ArcSight) to a location on the server. The task would be set to run periodically. As at the time of this writing (IIQ v 6.3), there was no OOTB API support to export reports to CEF format (Only csv and pdf).
I’ll describe the steps I took in creating the task to accomplish this in Sailpoint.
Create a TaskDefinition Object: The task definition would accept the report name and file location as input and will pass this information on to the custom java class that will process the task.
“Search Report” and “File Destination” are labels that will be displayed in the UI to users. “Search Report” will present the user with a drop-down to select reports (objects of type TaskDefinition) while “File Destination” will present users with a textbox to specify the file location.
Create the TaskDefinition executor: This is the custom java class that will receive the input from the TaskDefinition object and process the task. If you examine the xml file above, in the TaskDefinition tag, you will see an “executor” attribute with value “sailpoint.custom.ReportCEFExporterExecutor”.
ReportCEFExporterExecutor is the name of the java class and is located in package sailpoint.custom. The class must extend AbstractTaskExecutor, hence it must define methods execute() and terminate(). Refer to the sailpoint javadocs for more info.
For the purpose of brevity and focusing on the subject of this post, I will not go into the details of the logic on how I implemented the CEF standard. Instead, I have modified the executor to write the report name in a text file and store this file in the file location passed from the TaskDefinition object.
Deploy the custom task: To do this, you’ll need to import the TaskDefinition file into IIQ. You can do this in two ways:
•From IIQ navigate to System Setup-> Import from file -> browse to the xml file -> click on import
•From within IIQ Console, use the import command: import ReportTask.xml
After importing the TaskDefinition, you need to place the java class file in the appropriate location. The java class file needs to be placed in the classes.sailpoint.custom directory on the IIQ server.
Finally you need to restart the application server and you’re set to execute your custom task.