Wednesday, October 4, 2023

How to Call Task from TaskManager?

 import java.util.HashMap;

import java.util.Map;

import sailpoint.api.SailPointContext;

import sailpoint.api.TaskManager;

import sailpoint.object.Attributes;

import sailpoint.object.TaskDefinition;

import sailpoint.object.TaskResult;

import sailpoint.tools.GeneralException;


public class CallTask {

static SailPointContext context = null;


public static void main(String[] args) {

String taskName = "Test Rule";

Map map = new HashMap();

map.put("UserID", "000123");


Attributes attributes = new Attributes();

attributes.setMap(map);


try {

TaskManager taskManager = new TaskManager(context);

TaskDefinition taskDefinition = taskManager.getTaskDefinition(taskName);

TaskResult runWithResult = taskManager.runWithResult(taskDefinition, attributes);

runWithResult.getId();

} catch (GeneralException e) {

System.out.println("GeneralException: " + e.getMessage());

}

}

}

No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...