OrchestrationMetadata Class
- java.
lang. Object - com.
microsoft. durabletask. OrchestrationMetadata
- com.
public final class OrchestrationMetadata
Represents a snapshot of an orchestration instance's current state, including metadata.
Instances of this class are produced by methods in the DurableTaskClient class, such as DurableTaskClient#getInstanceMetadata, DurableTaskClient#waitForInstanceStart and DurableTaskClient#waitForInstanceCompletion
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| T |
readCustomStatusAs(Class<T> type)
Deserializes the orchestration's custom status into an object of the specified type. |
| T |
readInputAs(Class<T> type)
Deserializes the orchestration's input into an object of the specified type. |
| T |
readOutputAs(Class<T> type)
Deserializes the orchestration's output into an object of the specified type. |
| java.time.Instant |
getCreatedAt()
Gets the orchestration instance's creation time in UTC. |
|
Failure |
getFailureDetails()
Gets the failure details, if any, for the failed orchestration instance. |
| java.lang.String |
getInstanceId()
Gets the unique ID of the orchestration instance. |
| java.time.Instant |
getLastUpdatedAt()
Gets the orchestration instance's last updated time in UTC. |
| java.lang.String |
getName()
Gets the name of the orchestration. |
|
Orchestration |
getRuntimeStatus()
Gets the current runtime status of the orchestration instance at the time this object was fetched. |
| java.lang.String |
getSerializedInput()
Gets the orchestration instance's serialized input, if any, as a string value. |
| java.lang.String |
getSerializedOutput()
Gets the orchestration instance's serialized output, if any, as a string value. |
| boolean |
isCompleted()
Gets a value indicating whether the orchestration instance was completed at the time this object was fetched. |
| boolean |
isCustomStatusFetched()
Returns |
| boolean |
isInstanceFound()
Returns |
| boolean |
isRunning()
Gets a value indicating whether the orchestration instance was running at the time this object was fetched. |
| java.lang.String |
toString()
Generates a user-friendly string representation of the current metadata object. |
Methods inherited from java.lang.Object
Method Details
readCustomStatusAs
public T
Deserializes the orchestration's custom status into an object of the specified type.
Deserialization is performed using the DataConverter that was configured on the DurableTaskClient object that created this orchestration metadata object.
Parameters:
Returns:
readInputAs
public T
Deserializes the orchestration's input into an object of the specified type.
Deserialization is performed using the DataConverter that was configured on the DurableTaskClient object that created this orchestration metadata object.
Parameters:
Returns:
readOutputAs
public T
Deserializes the orchestration's output into an object of the specified type.
Deserialization is performed using the DataConverter that was configured on the DurableTaskClient object that created this orchestration metadata object.
Parameters:
Returns:
getCreatedAt
public Instant getCreatedAt()
Gets the orchestration instance's creation time in UTC.
Returns:
getFailureDetails
public FailureDetails getFailureDetails()
Gets the failure details, if any, for the failed orchestration instance.
This method returns data only if the orchestration is in the FAILED state, and only if this instance metadata was fetched with the option to include output data.
Returns:
nullgetInstanceId
public String getInstanceId()
Gets the unique ID of the orchestration instance.
Returns:
getLastUpdatedAt
public Instant getLastUpdatedAt()
Gets the orchestration instance's last updated time in UTC.
Returns:
getName
public String getName()
Gets the name of the orchestration.
Returns:
getRuntimeStatus
public OrchestrationRuntimeStatus getRuntimeStatus()
Gets the current runtime status of the orchestration instance at the time this object was fetched.
Returns:
getSerializedInput
public String getSerializedInput()
Gets the orchestration instance's serialized input, if any, as a string value.
Returns:
nullgetSerializedOutput
public String getSerializedOutput()
Gets the orchestration instance's serialized output, if any, as a string value.
Returns:
nullisCompleted
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 COMPLETED, FAILED, or TERMINATED.
Returns:
true if the orchestration was in a terminal state; otherwise falseisCustomStatusFetched
public boolean isCustomStatusFetched()
Returns true if the orchestration has a non-empty custom status value; otherwise false.
This method will always return false if the metadata was fetched without the option to read inputs and outputs
Returns:
true if the orchestration has a non-empty custom status value; otherwise falseisInstanceFound
public boolean isInstanceFound()
Returns true if an orchestration instance with this ID was found; otherwise false.
Returns:
true if an orchestration instance with this ID was found; otherwise falseisRunning
public boolean isRunning()
Gets a value indicating whether the orchestration instance was running at the time this object was fetched.
Returns:
true if the orchestration existed and was in a running state; otherwise falsetoString
public String toString()
Generates a user-friendly string representation of the current metadata object.
Overrides:
OrchestrationMetadata.toString()Returns: