Skip to content

🎨 core business process engine of Alibaba Halo platform, best process engine for trade scenes. | δΈ€δΈͺι«˜ζ€§θƒ½ζ΅η¨‹ηΌ–ζŽ’εΌ•ζ“Ž

License

Notifications You must be signed in to change notification settings

alibaba/compileflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
CompileFlow

CompileFlow

πŸš€ A High-Performance, Compile-Then-Execute Process Engine

Transforming business processes into optimized Java code for ultimate performance

Github Workflow Build Status Maven Central Java support License

GitHub Stars GitHub Forks

πŸ‡¨πŸ‡³ δΈ­ζ–‡ζ–‡ζ‘£

✨ What is CompileFlow?

CompileFlow is a lightweight, high-performance, integrable, and extensible process engine.

Focused on pure in-memory, stateless execution, the CompileFlow Process Engine is one of Taobao's original TBBPM workflow engines. It achieves exceptional efficiency by converting process files into Java code, which is then compiled and executed. It currently powers several core systems at Alibaba, including the Business Mid-end Platform and Trading systems.

CompileFlow allows developers to visually design business logic, bridging the gap between business analysts and engineers and making business expression more intuitive and efficient.

🎯 Key Highlights

  • ⚑ Ultra-High Performance - A compile-then-execute architecture delivers native Java performance.
  • πŸ”’ Type-Safe - Strong typing with compile-time validation reduces runtime errors.
  • πŸ”§ Production-Ready - Seamless Spring Boot integration, monitoring, and enterprise features.
  • πŸ“Š Multi-Standard - Supports both BPMN 2.0 and the TBBPM specification.
  • 🎨 Visual Design - An IntelliJ IDEA plugin is available for visual process modeling.

πŸš€ Quick Start

Get CompileFlow up and running in under 2 minutes.

A) With Spring Boot (Recommended)

This is the easiest and most recommended way to use CompileFlow in most applications.

1️⃣ Add Dependency

<dependency>
    <groupId>com.alibaba.compileflow</groupId>
    <artifactId>compileflow-spring-boot-starter</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</dependency>

2️⃣ Inject and Execute

The ProcessEngine is auto-configured as a singleton and can be injected directly.

@Service
public class BusinessService {

    @Autowired
    private ProcessEngine<TbbpmModel> processEngine;

    public MyResponse executeProcess(MyRequest request) {
        ProcessSource processSource = ProcessSource.fromCode("my.business.process");

        ProcessResult<MyResponse> result = processEngine.execute(
            processSource,
            request,
            MyResponse.class
        );

        return result.orElseThrow(() -> new RuntimeException(result.getErrorMessage()));
    }
}

B) Standalone Usage (Non-Spring)

For non-Spring applications, the recommended approach is to implement a manual singleton.

1️⃣ Add Dependencies

<dependency>
    <groupId>com.alibaba.compileflow</groupId>
    <artifactId>compileflow-core</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</dependency>
<!-- Add compileflow-tbbpm or compileflow-bpmn based on your process specification -->
<dependency>
    <groupId>com.alibaba.compileflow</groupId>
    <artifactId>compileflow-tbbpm</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</dependency>

2️⃣ Create a Singleton Engine and Execute

// ProcessEngineHolder.java
public final class ProcessEngineHolder {
    private static final ProcessEngine<TbbpmModel> INSTANCE = ProcessEngineFactory.createTbbpm();

    private ProcessEngineHolder() {}

    public static ProcessEngine<TbbpmModel> getInstance() {
        return INSTANCE;
    }

    // Call this from your application's shutdown hook
    public static void shutdown() {
        if (INSTANCE != null) {
            INSTANCE.close();
        }
    }
}

// YourApplication.java
public class YourApplication {
    public static void main(String[] args) {
        // At application startup, you can warm-up processes
        ProcessEngineHolder.getInstance().admin().deploy(ProcessSource.fromCode("..."));

        // In your business logic, get the singleton instance
        ProcessEngine<TbbpmModel> engine = ProcessEngineHolder.getInstance();
        engine.execute(...);

        // Register a shutdown hook to ensure resources are released
        Runtime.getRuntime().addShutdownHook(new Thread(ProcessEngineHolder::shutdown));
    }
}

⚠️ Important: For long-running applications (like web services), you must use a singleton. Creating a new engine per request will cause severe performance problems. See the Resource Management guide for more details.


πŸ“š Detailed Documentation

Document Description
πŸš€ Quick Start Guide A complete, runnable example in 5 minutes
⚠️ Resource Management Must Read! How to use the engine singleton correctly to avoid resource leaks
βš™οΈ Configuration Guide All available YAML and programmatic configuration options
API Reference Detailed reference for all public APIs
πŸ”₯ Hot Deployment Zero-downtime process update strategies for production
πŸ“Š Monitoring & Observability Integrating with events, metrics, and Prometheus
✨ Advanced Features Engine warm-up, custom ClassLoaders, and more
πŸ”§ Extension Guide Develop custom extensions via SPI
πŸ“‹ Node Support List TBBPM & BPMN 2.0 supported node details
πŸ› οΈ Contributing Guide How to contribute code and documentation to the project

🀝 Community


πŸ“œ License

CompileFlow is licensed under the Apache License 2.0

πŸŽ† Star History

Star History Chart

⭐ If CompileFlow helps you, please give us a star! ⭐

About

🎨 core business process engine of Alibaba Halo platform, best process engine for trade scenes. | δΈ€δΈͺι«˜ζ€§θƒ½ζ΅η¨‹ηΌ–ζŽ’εΌ•ζ“Ž

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages