vdaron / StatesLanguage

Helper classes to help creating and modifying workflow described using the Amazon States Language used by AWS StepFunctions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);
}

About

Helper classes to help creating and modifying workflow described using the Amazon States Language used by AWS StepFunctions

License:Apache License 2.0


Languages

Language:C# 100.0%