View Javadoc
1   package com.kodexa.client.remote;
2   
3   import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4   import lombok.Data;
5   
6   import java.util.*;
7   
8   /**
9    * An instance of an execution that is running in the Kodexa Cloud
10   */
11  @Data
12  @JsonIgnoreProperties(ignoreUnknown = true)
13  public class CloudExecution {
14  
15      /**
16       * Unique ID for the execution
17       */
18      private String id;
19  
20      /**
21       * The status of the execution
22       */
23      private String status;
24  
25      /**
26       * List of the step that are part of the execution
27       */
28      private List<CloudExecutionStep> steps;
29  
30      /**
31       * List of the stores available from the execution
32       */
33      private List<CloudStore> stores = new ArrayList<>();
34  
35      /**
36       * List of the content objects available from the execution
37       */
38      private List<ContentObject> contentObjects = new ArrayList<>();
39  
40  
41      /**
42       * The ID of the output document (content object)
43       */
44      private String outputId;
45  
46      /**
47       * The ID of the input document (content object)
48       */
49      private String inputId;
50  
51      /**
52       * Get the exception details from the steps
53       *
54       * @return exception details, or null if there wasn't an exception
55       */
56      public CloudExceptionDetail getExceptionDetail() {
57          for (CloudExecutionStep step : steps) {
58              if (step.getExceptionDetails() != null)
59                  return step.getExceptionDetails();
60          }
61          return null;
62      }
63  
64      public ContentObject getOutputDocument() {
65          return contentObjects.stream().filter(c -> c.getId().equals(outputId)).findFirst().orElse(null);
66      }
67  }