FLOW_RetryApiIssues
Class · Group: Web Services
global inherited sharing class FLOW_RetryApiIssuesRuns the failed calls of the API issues you select again, in one background job: from the Retry Selected action on the API Issues list, from your own flow, or from Apex. The issues that are still open are handed to the job. The job sends each distinct request once, skips an issue whose external system may already have acted, an issue of a call your org made whose service is paused or does not allow retries, and an issue whose call or record still has a call in progress, and marks resolved every issue whose call succeeds. An issue of a call your org received is replayed whatever its service's Retry Issues setting says. You need the Retry API Issue permission; without it nothing is queued and the message says so.
Example
FLOW_RetryApiIssues.DTO_Request request = new FLOW_RetryApiIssues.DTO_Request();
request.apiIssueIds = new List<String> {issueId};
FLOW_RetryApiIssues.DTO_Response response = FLOW_RetryApiIssues.retryApiIssues(new List<FLOW_RetryApiIssues.DTO_Request> {request}).get(0);Methods
| Method | Description |
|---|---|
| global static List<FLOW_RetryApiIssues.DTO_Response> retryApiIssues(List<FLOW_RetryApiIssues.DTO_Request> requests) | Queues a retry of the open issues among the ids you pass and tells you how many were queued. |
retryApiIssues
@InvocableMethod(category='Api Callouts' description='Runs the failed calls of the API issues you select again, in one background job. Needs the Retry API Issue permission.' label='Retry API Issues') global static List<FLOW_RetryApiIssues.DTO_Response> retryApiIssues(List<FLOW_RetryApiIssues.DTO_Request> requests)Queues a retry of the open issues among the ids you pass and tells you how many were queued. Ids that are not record ids and ids of other objects are left out. An issue is not queued, and stays open, when it is not open, when the external system may already have acted on it, or, for a call your org made, when its service is paused or does not allow retries; the message says how many of the open issues you named were queued and why the rest were not. The job may still skip a few, for example when a call for the same record is still running, and each issue shows its own result. The answer carries no count of the issues it left out.
Parameters
| Parameter | Type | Description |
|---|---|---|
requests | List | Exactly one request, holding the ids of the API issues to run again. |
Returns FLOW_RetryApiIssues.DTO_Response — One response: whether the request was accepted, the job id (null when nothing was queued), how many issues were queued, and a message.
Throws
| Exception | Description |
|---|---|
| IllegalArgumentException | When the list does not hold exactly one request. |
Example
FLOW_RetryApiIssues.DTO_Request request = new FLOW_RetryApiIssues.DTO_Request();
request.apiIssueIds = new List<String> {firstIssueId, secondIssueId};
FLOW_RetryApiIssues.DTO_Response response = FLOW_RetryApiIssues.retryApiIssues(new List<FLOW_RetryApiIssues.DTO_Request> {request}).get(0);
Assert.areEqual(2, response.queuedCount);Inner Classes
| Class | Description |
|---|---|
| DTO_Request | What the action is asked: the API issues to run again. |
| DTO_Response | What the action answers: the job, the count and a message for the person who asked. |