Class StepResultOutputAccessor
Provides an easy accessor for step output results.
Assembly: Taskurai.dll
public class StepResultOutputAccessor : IEnumerable<ResultOutput>, IEnumerable
Implements:
System.Collections.Generic.IEnumerable<Taskurai.Models.ResultOutput>, System.Collections.IEnumerable
Properties
this[string]
Gets the output by its name.
public ResultOutput this[string name] { get; }
Methods
GetOutput()
Gets the output.
When more than one return value is available, an exception is thrown.
public ResultOutput GetOutput()
Returns
Taskurai.Models.ResultOutput: The output if found; otherwise, null.### GetOutput(string)
Gets the output by its name.
public ResultOutput GetOutput(string name)
Returns
Taskurai.Models.ResultOutput: The output if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
GetExternalEvent(string)
Gets the external event by its name.
public ExternalEvent GetExternalEvent(string name)
Returns
Taskurai.Models.ExternalEvent: The output if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the external event. |
GetExternalEvent<T>(string)
Gets the external event by its name.
public T GetExternalEvent<T>(string name)
Returns
<T>: The output if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the external event. |
Type Parameters
T
GetExternalEvents()
Gets the external events.
public List<ExternalEvent> GetExternalEvents()
Returns
System.Collections.Generic.List<Taskurai.Models.ExternalEvent>: List of external events### GetExternalEvents<T>()
Gets the external events.
public List<T> GetExternalEvents<T>()
Returns
System.Collections.Generic.List<<T>>: List of external events##### Type Parameters
T
GetTaskCompletionEvent(string)
Gets the task completion event by its name.
public TaskCompletionEvent GetTaskCompletionEvent(string taskId)
Returns
Taskurai.Models.TaskCompletionEvent: Task completion event if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | taskId | Task id. |
GetTaskCompletionEvent<T>(string)
Gets the task completion event by its name.
public T GetTaskCompletionEvent<T>(string taskId)
Returns
<T>: Task completion event if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | taskId | Task id. |
Type Parameters
T
GetTaskCompletionEvents()
Gets the task completion event by its name.
public List<TaskCompletionEvent> GetTaskCompletionEvents()
Returns
System.Collections.Generic.List<Taskurai.Models.TaskCompletionEvent>: List of task completion events.### GetTaskCompletionEvents<T>()
Gets the task completion event by its name.
public List<T> GetTaskCompletionEvents<T>()
Returns
System.Collections.Generic.List<<T>>: List of task results.##### Type Parameters
T
GetStateReference()
Gets the output state reference.
When more than one return value is available, an exception is thrown.
public StateReference GetStateReference()
Returns
Taskurai.Models.StateReference: The output state reference if found; otherwise, null.### GetStateReference(string)
Gets the output state reference by its name.
public StateReference GetStateReference(string name)
Returns
Taskurai.Models.StateReference: The output state reference if found; otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
GetValue<T>(JsonSerializerOptions)
Gets the output value and attempts to deserialized it to the specified type.
When more than one return value is available, an exception is thrown.
When the output is a state reference, an exception is thrown.
public T GetValue<T>(JsonSerializerOptions options = null)
Returns
<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.
Parameters
| Type | Name | Description |
|---|---|---|
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
GetValue<T>(string, JsonSerializerOptions)
Gets the output value by its name and attempts to deserialized it to the specified type.
When the output is a state reference, an exception is thrown.
public T GetValue<T>(string name, JsonSerializerOptions options = null)
Returns
<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
ToString()
Gets the output string value and attempts to deserialized it to the specified type.
When more than one return value is available, an exception is thrown.
When the output is a state reference, an exception is thrown.
public override string ToString()
Returns
System.String: The value of the output value as string if found; otherwise, otherwise, null.### ToString(string)
Gets the output string value by its name and attempts to deserialized it to the specified type.
When the output is a state reference, an exception is thrown.
public string ToString(string name)
Returns
System.String: The value of the output value as string if found; otherwise, otherwise, null.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the output. |
GetValue<T>(ResultOutput, JsonSerializerOptions)
Gets the output value and attempts to deserialized it to the specified type.
When the output is a state reference, an exception is thrown.
protected T GetValue<T>(ResultOutput output, JsonSerializerOptions options = null)
Returns
<T>: The value of the output deserialized to specified type T if found; otherwise, the default value.
Parameters
| Type | Name | Description |
|---|---|---|
| Taskurai.Models.ResultOutput | output | The output. |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
GetOutputsByType<T>(string)
Gets all output values that match the specified type.
public ResultOutput[] GetOutputsByType<T>(string type)
Returns
Taskurai.Models.ResultOutput[]: An array of output results.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type of the output |
Type Parameters
T
GetStateReferencesByType<T>(string)
Gets all output state references that match the specified type.
public StateReference[] GetStateReferencesByType<T>(string type)
Returns
Taskurai.Models.StateReference[]: An array of state references.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type of the output |
Type Parameters
T
GetValuesByType<T>(string, JsonSerializerOptions)
Gets all output values that match the specified type.
When the output is a state reference, an exception is thrown.
public T[] GetValuesByType<T>(string type, JsonSerializerOptions options = null)
Returns
<T>[]: An array of output values deserialized to the specified type T.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | type | Type of the output |
System.Text.Json.JsonSerializerOptions | options | The System.Text.Json.JsonSerializerOptions to use when serializing to JSON. |
Type Parameters
| Name | Description |
|---|---|
T | The type to deserialized the output's value to. |
GetEnumerator()
Returns an enumerator that iterates through the collection of Taskurai.Models.ResultOutput.
public IEnumerator<ResultOutput> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<Taskurai.Models.ResultOutput>: An enumerator for the collection of output results.
Implements
System.Collections.Generic.IEnumerable<Taskurai.Models.ResultOutput>System.Collections.IEnumerable