Class State

java.lang.Object
com.jedox.etl.components.scriptapi.State

public class State extends Object
State of the currently active or any finished Integrator execution. Get the state of the currently active execution with e.g. ExecutionAPI.getState(). JobAPI.executeJob(String) or JobAPI.executeLoad(String) return the state after the executions completed.

 state = API.executeJob("Initdata");
 LOG.info("Status: {}, Errors: {}, Warnings: {}", state.getStatus(), state.getErrors(), state.getWarnings());
 
  • Method Details

    • isOK

      public Boolean isOK()
      Tests if this execution state's result code is ok.
      Returns:
      true if the result code is ResultCodes.Codes.OK or ResultCodes.Codes.WARNINGS, false otherwise
    • getName

      public String getName()
      Returns the name of this execution (e.g. "myJob").
      Returns:
      the name of this execution as String
    • getType

      public String getType()
      Returns the type of this execution (e.g. "job").
      Returns:
      the type of this execution as String
    • getStatus

      public String getStatus()
      Returns the status of this execution (e.g. "Completed successfully").
      Returns:
      the status of this execution as String
    • getWarnings

      public Integer getWarnings()
      Returns the number of warnings that occurred in this execution.
      Returns:
      the number of warnings in this execution
    • getErrors

      public Integer getErrors()
      Returns the number of errors that occurred in this execution.
      Returns:
      the number of errors in this execution
    • getFirstErrorMessage

      public String getFirstErrorMessage()
      Returns the error message of the first error occurring in this execution.
      Returns:
      the error message of the first error message occurring in this execution
    • getLog

      public String getLog()
      Returns the complete execution log of this execution.
      Returns:
      the complete execution log of this execution
    • getLog

      public String getLog(String logLevel)
      Returns the execution log of this execution filtered by log level. If logLevel is set to "WARN", the returned string does not contain any log entries of type DEBUG or INFO.
      Parameters:
      logLevel - the log level to use to filter the execution log
      Returns:
      the entries of the execution log with a log level that is equal or greater as logLevel
    • getStartDate

      public Date getStartDate()
      Returns the time at which this execution started.
      Returns:
      the start time of this execution as Date
    • getStopDate

      public Date getStopDate()
      Returns the time at which this execution terminated.
      Returns:
      the end time of this execution as Date
    • getData

      public String getData()
      Returns the result of this execution as a string. Only source components (extracts, transforms, table/tree sources) add the data they produce to the execution state when executed.
      Returns:
      the result data of this execution as String
    • getExecutionId

      public Long getExecutionId()
      Returns the internal execution id of this execution.
      Returns:
      the internal execution id of this execution
    • getExecutionParentId

      public Long getExecutionParentId()
      Returns the execution id of the parent execution which has started the execution represented by this state. Only nested job executions started from a parallel parent job have their own execution id.
      Returns:
      the execution if of the parent execution or null
    • getUserName

      public String getUserName()
      Returns the name of the user who has started this execution.
      Returns:
      the name of the user who has started this execution