Hi Thomas,
1. You can create a method using the pseudocode below in the service which works with the API:
public Response waitExecutionCompletion(Long executionId, Conf configuration) {
// equal 3h
long timeout = 11000;
long timeWaiting = 0;
interval = 20;
// to avoid endless waiting we use timeout
while (timeWaiting <= timeout) {
timeWaiting += interval;
// wait for 20 seconds and then sand request
TimeUnit.SECONDS.sleep(interval);
Response executionResponse = sendGetRequestOnPlatform(executionId, configuration);
List < String > finalStates = Arrays.asList("COMPLETED", "ERROR", "CANCELLED", "NONE", "GATEWAY_DENIED");
String executionState = executionResponse.getExecutionState();
if (executionState != null && finalStates.contains(executionState)) {
return executionResponse;
}
}
throw new TimeoutException("Execution '" + executionId + "' failed by timeout");
}
then invoke it with:
Response r = waitExecutionCompletion(17777, configuration);
2. Yes, you can use the below endpoints where “891” should contain the execution ID. They will provide a summary in either JSON or HTML format.
https://platform.subject-7.com/api/v1/executionService/reports/executions/891/json
https://platform.subject-7.com/api/v1/executionService/reports/executions/891/html
3. No, there is no such flag or property. Server-to-server call is a solution. If you would like to simplify this approach, please submit a feature request.
Regards,
Subject7 Team