Monday, August 21, 2023

Set TaskStatus

import org.apache.commons.logging.Log;

import sailpoint.api.SailPointContext;

import sailpoint.object.TaskResult;

import sailpoint.tools.GeneralException;

public class SetTaskStatus {

static Log log = null;

static SailPointContext context = null;

public static void main(String[] args) {

int count = 316;

TaskResult taskResult = null;

try {

taskResult = context.getObjectByName(TaskResult.class, "Mighty Task");

if (taskResult != null) {

taskResult.addAttribute("count", count);

taskResult.setCompletionStatus(taskResult.getCompletionStatus().Success);

}

} catch (GeneralException e) {

log.error("GeneralException: " + e.getMessage());

taskResult.setCompletionStatus(taskResult.getCompletionStatus().Error);

}

}

}

 

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...