[Open Source] Java Flow General-Purpose Flow Orchestration Application Development Framework Supporting Various Known Flow Orchestration Scenarios

Open SourceProcess Management
2026-06-28 06:07 1 次浏览 • 0 次下载 0KB
[Open Source] Java Flow General-Purpose Flow Orchestration Application Development Framework Supporting Various Known Flow Orchestration Scenarios

1. Project Overview

Solon-Flow

Java Flow General-Purpose Flow Orchestration Application Development Framework (Supports Various Known Flow Orchestration Scenarios)
[Based on Solon application development framework]

A Java Flow (flow orchestration) application development framework designed for all scenarios. It is part of the Solon project. It can also be embedded in frameworks such as SpringBoot2, jFinal, and Vert.x.

2. Open Source License

Licensed under Apache-2.0

3. Screenshots

Image

4. Feature Overview

Solon Flow is a general-purpose flow orchestration engine. It can be used for computational (or task) orchestration scenarios; business rule and decision-processing orchestration scenarios; office approval workflows (stateful, interruptible, and involving human participation); and long-running workflows (combining automatic progression with waiting for human intervention).

A Java Flow (flow orchestration) application development framework designed for all scenarios. It is part of the Solon project. It can also be embedded in frameworks such as SpringBoot2, jFinal, and Vert.x.

Supports Various Known Flow Orchestration Scenarios:

  • Suitable for computational (or task) orchestration scenarios
  • Suitable for business rule and decision-processing orchestration scenarios
  • Suitable for office approval workflows (stateful, interruptible, and involving human participation)
  • Suitable for long-running workflows (combining automatic progression with waiting for human intervention)

5. Tech Stack

Overview of Six Key Features

1. Uses YAML Format

Simple Configuration and Clear Relationships

# c1.yml
id: "c1"
layout:
  - { id: "n1", type: "start", link: "n2"}
  - { id: "n2", type: "activity", link: "n3"}
  - { id: "n3", type: "end"}

Also supports simplified mode, where everything that can be automatically inferred is handled automatically. See the relevant documentation for details.

# c1.yml
id: "c1"
layout:
  - { type: "start"}
  - { task: ""}
  - { type: "end"}

2. Flexible Expressions and Scripts

# c2.yml
id: "c2"
layout:
  - { type: "start"}
  - { when: "order.getAmount() >= 100", task: "order.setScore(0);"}
  - { when: "order.getAmount() > 100 && order.getAmount() <= 500", task: "order.setScore(100);"}
  - { when: "order.getAmount() > 500 && order.getAmount() <= 1000", task: "order.setScore(500);"}
  - { type: "end"}

3. Metadata Configuration Provides Unlimited Extensibility (Each Workflow Essentially Comes with Its Own Metadata Database)

# c3.yml
id: "c3"
layout:
  - { id: "n1", type: "start", link: "n2"}
  - { id: "n2", type: "activity", link: "n3", meta: {cc: ""}, task: "@MetaProcessCom"}
  - { id: "n3", type: "end"}

Achieve CC Configuration Through Components

@Component("MetaProcessCom")
public class MetaProcessCom implements TaskComponent {
    @Override
    public void run(FlowContext context, Node node) throws Throwable {
       String cc = node.getMeta("cc");
       if(Utils.isNotEmpty(cc)){
           //Send email...
       }
    }
}

The CC functionality can also be implemented through a customized driver (although this approach is somewhat more heavyweight)

public class OaFlowDriver extends SimpleFlowDriver {
    @Override
    public void handleTask(FlowContext context, Task task) throws Throwable {
        if (Utils.isEmpty(task.getDescription())) {
           String cc = task.getNode().getMeta("cc");
           if(Utils.isNotEmpty(cc)){
               //Send email
           }
        } else {
            super.handleTask(context, task);
        }
    }
}
//FlowEngine flowEngine = FlowEngine.newInstance();
//flowEngine.register(new OaFlowDriver()); //Replace the default driver

4. Event Broadcasting and Callback Support

Broadcasting (sending messages only) and callbacks (sending messages and requiring a response)

id: f4
layout:
  - task: |
//Send only
      context.<String,String>eventBus().send("demo.topic", "hello");  //Supports generics (specify the type as needed; defaults to object if not specified)
  - task: |
//Send and require a response (a reply is required)
String rst = context.<String,String>eventBus().sendAndRequest("demo.topic.get", "hello");
System.out.println(rst);

5. Supports Two Requirement Categories: "Stateless" and "Stateful"

Supports a Wide Range of Application Scenarios:

  • Suitable for computational (or task) orchestration scenarios
  • Suitable for business rule and decision-processing orchestration scenarios
  • Suitable for office approval workflows (stateful, interruptible, and involving human participation)
  • Suitable for long-running workflows (combining automatic progression with waiting for human intervention)

It also functions as a low-code execution engine (a single YML file can meet all execution requirements).

6. Customizable Drivers (Similar to JDBC, Which Has MySql, PostgreSQL, and Potentially Elasticsearch)

This is a customized implementation demonstrating a state-driven flow engine.

StatefulFlowEngine flowEngine = new StatefulFlowEngine(StatefulSimpleFlowDriver.builder()
                .stateOperator(new MetaStateOperator("actor"))
                .stateRepository(new InMemoryStateRepository())
                .build());

var context = new StatefulFlowContext("i1").put("actor", "Chen Xin");
//Get the active node for the user in the current context
var statefulNode = flowEngine.getActivityNode("f1", context);
assert "step2".equals(statefulNode.getNode().getId());
assert StateType.UNKNOWN == statefulNode.getState(); //Cannot start the task due to insufficient permissions (no operator has been configured)
//Submit the active status
flowEngine.postActivityState(context, "f1", statefulNode.getNode().getId(), StateType.COMPLETED);

Workflow Configuration Example:

id: f1
layout:
  - {id: step1, title: "Initiate Approval", type: "start"}
  - {id: step2, title: "CC", meta: {cc: "Lu Fang"}, task: "@OaMetaProcessCom"}
  - {id: step3, title: "Approval", meta: {actor: "Chen Xin", cc: "Lu Fang"}, task: "@OaMetaProcessCom"}
  - {id: step4, title: "Approval", type: "parallel", link: [step4_1, step4_2]}
  - {id: step4_1, meta: {actor: "Chen Yu"}, link: step4_end}
  - {id: step4_2, meta: {actor: "Lu Fang"}, link: step4_end}
  - {id: step4_end, type: "parallel"}
  - {id: step5, title: "CC", meta: {cc: "Lu Fang"}, task: "@OaMetaProcessCom"}
  - {id: step6, title: "End", type: "end"}

For driver customization, we can also customize (or select) different script executors, component container implementations, and more.

6. Source Code Repository

Source code download

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare