brainslug is a control flow abstraction library. It enables you to model your application flow as a graph of typed nodes, which can be transformed to different representations or be executed within a customisable environment.
The current version is available in the maven central repository
FlowDefinition helloWorldFlow = new FlowBuilder() {
@Override
public void define() {
flowId(id("helloFlow"));
start(id("start")).execute(task(id("helloTask"), new SimpleTask() {
@Override
public void execute(ExecutionContext context) {
System.out.println("Hello World!");
}
}));
}
}.getDefinition();
// create brainslug context with defaults
BrainslugContext context = new BrainslugContextBuilder().build();
context.addFlowDefinition(helloWorldFlow);
context.startFlow(helloWorldFlow.getId(), IdUtil.id("start"));
Rendered as:
Check the project Github Pages for examples and documentation.
Starting with version 1.0.0, brainslug will follow semantic versioning. During the 0.x releases, the minor (.x) releases may include breaking changes.
brainslug is published under the terms of the Apache 2.0 License. See the LICENSE file.