Not able to save BatchRequestItem 'status' and 'result' values in a Workflow step

Which IIQ version are you inquiring about?

Version 8.2

Share all details related to your problem, including any error messages you may have received.

Hi,
Not able to save BatchRequestItem ‘status’ and ‘result’ values in a Workflow step

We have a workflow which is invoked when a Batch Request is run in Sailpoint IIQ.
We see that once the batch request is executed, “result” is set as “Success” and “status” is set to “Finished”. This is weird because in the same Workflow code, we are setting the “message” value as well, and the “message” value is coming the same as what we are setting it to, using the workflow code.

We want to set the BatchRequestItem properties like result, status, message in a single piece of code. But our code is not able to save result and status attributes correctly. We are using OOTB Sailpoint APIs only. We have tried to run this code snippet using multiple ways :

  1. Direct script
  2. Rule
  3. Method

Kindly help us with this as on compass community also, we are not able to find any relevant articles. Below is the code snippet which we are running in the workflow step.

BatchRequestItem batchRequestItem = context.getObjectById(BatchRequestItem.class,batchRequestItemId);
if(batchRequestItem!=null){
batchRequestItem.setStatus(BatchRequestItem.Status.Terminated);
batchRequestItem.setMessage(“The Identity is inactive”);
batchRequestItem.setResult(BatchRequestItem.Result.Failed);
context.saveObject(batchRequestItem);
context.commitTransaction();
}

NOTE: Line number 376 in workflow file

in this step only we are running the rule to update and save the BatchRequestItem

Can you provide your workflow xml and rule xml you are using?

Also are you saying, same code is working in your custom workflow but not in rule?

Hi Satish,
PFA both the files.
No, this logic to save BatchRequestItem ‘status’ and ‘result’ is not working in any case, we have tried it in the custom workflow & as well as the Rule. But in both, the only attribute we can save for BatchRequestItem is the ‘message’. Both “result” is set as “Success” and “status” is set to “Finished” upon workflow completion.

Kindly let us know if you have any workaround for this.

Did you map this workflow to any of the OOTB Batch Request process in Life Cylcle Manager → Business Process?

Yes , its mapped to “Batch Request Access” under the Lifecycle Manager → Business Process.

Hi Utsav,
I’ve just executed your rule on one of my sandbox batch requests and it works correctly

What I suggest is to set trace variable in the workflow to true in order to track if workflow is correctly entering the step which should set BatchRequestItem status.

Hi Kamil, thanks
Can you please confirm if you ran it using the rule only?
I mean for a batchrequestitem, if I run a rule in debug page to update result/status then it will work and update result/status of batchrequestitem.
Our issue is that, when we do a batch request and the attached workflow runs, it references a rule (attached), which will run below code

batchRequestItem.setStatus(BatchRequestItem.Status.Terminated);
batchRequestItem.setMessage(“The Identity is inactive”);
batchRequestItem.setResult(BatchRequestItem.Result.Failed);
context.saveObject(batchRequestItem);
context.commitTransaction();

but this way, it is not saving Status and Result…only the Message value is getting saved for batchrequestitem…please advise

I doubt you can do this within the same workflow, setting the status.

If your requirement is to just update the Item status for tracking, may be you can try a workaround, as you already have the ID, call a workflow which will be scheduled may be after 5 min or so ( make this configurable) and within that workflow call your custom rule to update the status and Result of Batch Request Item.

Hope this works for you, if this doesn’t satisfy your requirement, let us know.

hi Satish,
Thanks for the suggestion. We will apply this workaround and let you know.

Sure, please keep posted on how it goes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.