Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sailpoint.object.Filter;
- import sailpoint.object.Filter.MatchMode;
- import sailpoint.object.WorkflowCase;
- import sailpoint.object.Workflow;
- import sailpoint.object.Attributes;
- import sailpoint.object.QueryOptions;
- import sailpoint.object.TaskResult;
- import org.apache.log4j.Logger;
- Logger log =Logger.getLogger("gca.framework");
- log.debug("------ Entering : Find Workflows with Missing TaskResults ------");
- boolean readOnly = false;
- List savedTaskResults = new ArrayList();
- QueryOptions qo = new QueryOptions();
- Iterator it = context.search(WorkflowCase.class, qo);
- int counter = 0;
- int counterAll = 0;
- while (it.hasNext()) {
- WorkflowCase wfCase = (WorkflowCase) it.next();
- Workflow wf = wfCase.getWorkflow();
- if(wf != null && wf.getVariables() != null) {
- counterAll++;
- Attributes attrs = wf.getVariables();
- String taskResultID = attrs.getString("taskResultId");
- if(taskResultID == null || context.getObjectById(TaskResult.class, taskResultID) == null) {
- counter++;
- log.debug("[" + counter + "] wfCase missing taskResult: " + wfCase.getId() + " || " + wfCase.getName());
- }
- }
- }
- log.debug(counter + " workflowCases found without TaskResults out of " + counterAll + " workflowCases");
- log.debug("----- Exiting : Find Workflows with Missing TaskResults -----");
- return "success";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement