Brainslug

Brainslug

brainslug is a control flow abstraction library. It allows to model business logic flow of an application as a graph of typed nodes, which can be transformed to different representations or be executed within a customisable environment.

Features

  • Builder DSL for flow definitions

  • BPMN 2.0 XML export using the Activiti Model

  • Flow Renderer based on the BPMN symbols

  • Quartz Scheduler for Async Tasks

Example

FlowBuilder simpleFlow = new FlowBuilder() {
  @Override
  public void define() {
    flowId(id("simpleFlow"));

    start(event(id("start")))
      .execute(task(id("task")).display("A Task"))
      .execute(task(id("task2")).display("Another Task"))
        .end(event(id("end")));
  }
};

represents the the following flow:

task_flow

Download

The current version is available in the maven central repository

<dependencies>
...
  <dependency>
    <groupId>de.androbit</groupId>
    <artifactId>brainslug-core</artifactId>
    <version>...</version>
  </dependency>
...
</dependencies>