Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.64 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.64 KB

States Language

This library contains some helper classes to help creating and modifying workflow using the Amazon States Language. This is the workflow description language used by AWS StepFunctions

This project starts as a port of the java livrary light-workflow-4j project.

StateMachine Builder

StateMachine stateMachine = StateMachineBuilder.StateMachine()
    .StartAt("InitialState")
    .TimeoutSeconds(30)
    .Comment("My Simple State Machine")
    .State("InitialState", StateMachineBuilder.SucceedState()
        .Comment("Initial State")
        .InputPath("$.input")
        .OutputPath("$.output"))
    .Build();

string json = stateMachine.ToJson();

var builder = StateMachine.FromJson(json);

Tools

InputOutputProcessor

public interface IInputOutputProcessor
{
    JToken GetEffectiveInput(JToken input, OptionalString inputPath, JObject payload, JObject context);
    JToken GetEffectiveResult(JToken output, JObject payload, JObject context);
    JToken GetEffectiveOutput(JToken input, JToken result, OptionalString outputPath, OptionalString resultPath);
}

IntrinsicFunctions support

There is a IIntrinsicFunctionRegistry available to register your StateLanguage Intrinsic functions.

The Standard Intrinsic functions defined here are already included in the registry.

public interface IIntrinsicFunctionRegistry
{
    void Register(string name, IntrinsicFunctionFunc func);
    void Unregister(string name);
}