Class OrchestrationMetadata
Instances of this class are produced by methods in the DurableTaskClient class, such as
DurableTaskClient.getInstanceMetadata(java.lang.String, boolean), DurableTaskClient.waitForInstanceStart(java.lang.String, java.time.Duration) and
DurableTaskClient.waitForInstanceCompletion(java.lang.String, java.time.Duration, boolean).
-
Method Summary
Modifier and TypeMethodDescriptionGets the orchestration instance's creation time in UTC.Gets the failure details, if any, for the failed orchestration instance.Gets the unique ID of the orchestration instance.Gets the orchestration instance's last updated time in UTC.getName()Gets the name of the orchestration.Gets the current runtime status of the orchestration instance at the time this object was fetched.Gets the orchestration instance's serialized input, if any, as a string value.Gets the orchestration instance's serialized output, if any, as a string value.booleanGets a value indicating whether the orchestration instance was completed at the time this object was fetched.booleanReturnstrueif the orchestration has a non-empty custom status value; otherwisefalse.booleanReturnstrueif an orchestration instance with this ID was found; otherwisefalse.booleanGets a value indicating whether the orchestration instance was running at the time this object was fetched.<T> TreadCustomStatusAs(Class<T> type) Deserializes the orchestration's custom status into an object of the specified type.<T> TreadInputAs(Class<T> type) Deserializes the orchestration's input into an object of the specified type.<T> TreadOutputAs(Class<T> type) Deserializes the orchestration's output into an object of the specified type.toString()Generates a user-friendly string representation of the current metadata object.
-
Method Details
-
getName
Gets the name of the orchestration.- Returns:
- the name of the orchestration
-
getInstanceId
Gets the unique ID of the orchestration instance.- Returns:
- the unique ID of the orchestration instance
-
getRuntimeStatus
Gets the current runtime status of the orchestration instance at the time this object was fetched.- Returns:
- the current runtime status of the orchestration instance at the time this object was fetched
-
getCreatedAt
Gets the orchestration instance's creation time in UTC.- Returns:
- the orchestration instance's creation time in UTC
-
getLastUpdatedAt
Gets the orchestration instance's last updated time in UTC.- Returns:
- the orchestration instance's last updated time in UTC
-
getSerializedInput
Gets the orchestration instance's serialized input, if any, as a string value.- Returns:
- the orchestration instance's serialized input or
null
-
getSerializedOutput
Gets the orchestration instance's serialized output, if any, as a string value.- Returns:
- the orchestration instance's serialized output or
null
-
getFailureDetails
Gets the failure details, if any, for the failed orchestration instance.This method returns data only if the orchestration is in the
OrchestrationRuntimeStatus.FAILEDstate, and only if this instance metadata was fetched with the option to include output data.- Returns:
- the failure details of the failed orchestration instance or
null
-
isRunning
public boolean isRunning()Gets a value indicating whether the orchestration instance was running at the time this object was fetched.- Returns:
trueif the orchestration existed and was in a running state; otherwisefalse
-
isCompleted
public boolean isCompleted()Gets a value indicating whether the orchestration instance was completed at the time this object was fetched.An orchestration instance is considered completed when its runtime status value is
OrchestrationRuntimeStatus.COMPLETED,OrchestrationRuntimeStatus.FAILED, orOrchestrationRuntimeStatus.TERMINATED.- Returns:
trueif the orchestration was in a terminal state; otherwisefalse
-
readInputAs
Deserializes the orchestration's input into an object of the specified type.Deserialization is performed using the
DataConverterthat was configured on theDurableTaskClientobject that created this orchestration metadata object.- Type Parameters:
T- the type to deserialize the input data into- Parameters:
type- the class associated with the type to deserialize the input data into- Returns:
- the deserialized input value
- Throws:
IllegalStateException- if the metadata was fetched without the option to read inputs and outputs
-
readOutputAs
Deserializes the orchestration's output into an object of the specified type.Deserialization is performed using the
DataConverterthat was configured on theDurableTaskClientobject that created this orchestration metadata object.- Type Parameters:
T- the type to deserialize the output data into- Parameters:
type- the class associated with the type to deserialize the output data into- Returns:
- the deserialized input value
- Throws:
IllegalStateException- if the metadata was fetched without the option to read inputs and outputs
-
readCustomStatusAs
Deserializes the orchestration's custom status into an object of the specified type.Deserialization is performed using the
DataConverterthat was configured on theDurableTaskClientobject that created this orchestration metadata object.- Type Parameters:
T- the type to deserialize the custom status data into- Parameters:
type- the class associated with the type to deserialize the custom status data into- Returns:
- the deserialized input value
- Throws:
IllegalStateException- if the metadata was fetched without the option to read inputs and outputs
-
isCustomStatusFetched
public boolean isCustomStatusFetched()Returnstrueif the orchestration has a non-empty custom status value; otherwisefalse.This method will always return
falseif the metadata was fetched without the option to read inputs and outputs.- Returns:
trueif the orchestration has a non-empty custom status value; otherwisefalse
-
toString
Generates a user-friendly string representation of the current metadata object. -
isInstanceFound
public boolean isInstanceFound()Returnstrueif an orchestration instance with this ID was found; otherwisefalse.- Returns:
trueif an orchestration instance with this ID was found; otherwisefalse
-