Table of Contents

Interface IAppStateMachineExecutionContext<T>

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll
public interface IAppStateMachineExecutionContext<T> where T : struct, Enum

Type Parameters

T

Properties

Bucket

The state machine bucket name

string Bucket { get; }

Property Value

string

DeploymentId

The deployment id in which this state machine was submitted

long DeploymentId { get; }

Property Value

long

FromState

The target state from which the machine is transitioning

T FromState { get; }

Property Value

T

Progress

Update the progress percentage of this state machine

int Progress { set; }

Property Value

int

Result

Set the result of this state machine (if any)

object Result { get; set; }

Property Value

object

RunCount

Time this state has been run/retried

int RunCount { get; }

Property Value

int

StateId

The current state id

long StateId { get; }

Property Value

long

StateMachineId

The current state machine id

Guid StateMachineId { get; }

Property Value

Guid

Status

Update the progress status of this state machine

string Status { set; }

Property Value

string

ToState

The target state towards which the machine is transitioning

T ToState { get; }

Property Value

T

Methods

Cancel()

Cancel fsm

void Cancel()

Cancel(string)

Cancel job

void Cancel(string message)

Parameters

message string

CompleteAsync(IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

fromStates IEnumerable<T>
toState T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

CompleteAsync(IEnumerable<T>, T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

fromStates IEnumerable<T>
toState T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

CompleteAsync(T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

state T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

CompleteAsync(T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

state T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

CompleteAsync(T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

fromState T
toState T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

CompleteAsync(T, T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> CompleteAsync(T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

fromState T
toState T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

Faulted(Exception)

Mark the fsm as Faulted (Glow will not retry current state)

void Faulted(Exception exception)

Parameters

exception Exception

Faulted(Exception, string)

Mark the fsm as Faulted (Glow will not retry current state)

void Faulted(Exception exception, string message)

Parameters

exception Exception
message string

Faulted(string)

Mark the fsm as Faulted (Glow will not retry current state)

void Faulted(string message)

Parameters

message string

GetData<TData>()

Get input data (deserialize)

TData GetData<TData>()

Returns

TData

Type Parameters

TData

Reschedule(DateTimeOffset)

Reschedule the current state to run at the specified time.

void Reschedule(DateTimeOffset runAtTime)

Parameters

runAtTime DateTimeOffset

Reschedule(TimeSpan)

Reschedule the job to run after some time from now.

void Reschedule(TimeSpan timespan)

Parameters

timespan TimeSpan

SetStateAsync(IEnumerable<T>, T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(IEnumerable<T> fromStates, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

fromStates IEnumerable<T>
toState T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

SetStateAsync(IEnumerable<T>, T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(IEnumerable<T> fromStates, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

fromStates IEnumerable<T>
toState T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

SetStateAsync(T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T state, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

state T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

SetStateAsync(T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T state, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

state T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

SetStateAsync(T, T, object, CancellationToken, GlowAppScope, AppDataSerializer)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T fromState, T toState, object data, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service, AppDataSerializer serializer = AppDataSerializer.Json)

Parameters

fromState T
toState T
data object
cancellationToken CancellationToken
scope GlowAppScope
serializer AppDataSerializer

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>

SetStateAsync(T, T, CancellationToken, GlowAppScope)

IAppStateMachineService.IAppStateMachineSetStateBuilder<T> SetStateAsync(T fromState, T toState, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

fromState T
toState T
cancellationToken CancellationToken
scope GlowAppScope

Returns

IAppStateMachineService.IAppStateMachineSetStateBuilder<T>