Class State
java.lang.Object
com.jedox.etl.components.scriptapi.State
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 Summary
Modifier and TypeMethodDescriptiongetData()
Returns the result of this execution as a string.Returns the number of errors that occurred in this execution.Returns the internal execution id of this execution.Returns the execution id of the parent execution which has started the execution represented by this state.Returns the error message of the first error occurring in this execution.getLog()
Returns the complete execution log of this execution.Returns the execution log of this execution filtered by log level.getName()
Returns the name of this execution (e.g.Returns the time at which this execution started.Returns the status of this execution (e.g.Returns the time at which this execution terminated.getType()
Returns the type of this execution (e.g.Returns the name of the user who has started this execution.Returns the number of warnings that occurred in this execution.isOK()
Tests if this execution state's result code is ok.
-
Method Details
-
isOK
Tests if this execution state's result code is ok.- Returns:
true
if the result code isResultCodes.Codes.OK
orResultCodes.Codes.WARNINGS
,false
otherwise
-
getName
Returns the name of this execution (e.g."myJob"
).- Returns:
- the name of this execution as
String
-
getType
Returns the type of this execution (e.g."job"
).- Returns:
- the type of this execution as
String
-
getStatus
Returns the status of this execution (e.g."Completed successfully"
).- Returns:
- the status of this execution as
String
-
getWarnings
Returns the number of warnings that occurred in this execution.- Returns:
- the number of warnings in this execution
-
getErrors
Returns the number of errors that occurred in this execution.- Returns:
- the number of errors in this execution
-
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
Returns the complete execution log of this execution.- Returns:
- the complete execution log of this execution
-
getLog
Returns the execution log of this execution filtered by log level. IflogLevel
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
Returns the time at which this execution started.- Returns:
- the start time of this execution as
Date
-
getStopDate
Returns the time at which this execution terminated.- Returns:
- the end time of this execution as
Date
-
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
Returns the internal execution id of this execution.- Returns:
- the internal execution id of this execution
-
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
Returns the name of the user who has started this execution.- Returns:
- the name of the user who has started this execution
-