BPM Rule Demo
Where the demo lives — the
workflow-demoplugin used throughout this page ships with the enterprise application composition, not in the community repository. Every concept, API and command shown here works the same against the community edition's SmartEngine BPM; only the demo source files are not in this repo.
The complete write-up is in Chinese for now: BPM Rule 示例. This page keeps the English route accurate and links to the runnable source-backed scenario.
workflow-demo ships two BPM rules:
| Rule | Type | Purpose | Source |
|---|---|---|---|
wd_leave_validation | VALIDATION | Blocks annual leave with insufficient balance and sick leave over 2 days without attachment | plugins/workflow-demo/rules/wd_leave_validation.drl |
wd_leave_routing | CONDITION | Routes leave under 3 days to wd_manager, otherwise to wd_hr | plugins/workflow-demo/rules/wd_leave_routing.drl |
The rules are declared in plugins/workflow-demo/config/rules.json. The routing rule is called by the svc_rule_route node in wd_leave_approval; the validation rule runs before the process starts.
Useful API surfaces:
POST /api/bpm/rules/validatePOST /api/bpm/rules/{pid}/evaluateGET /api/bpm/rules?type=CONDITION
For the runnable flow, seed data with:
node docs/screenshot-seeds/seed_workflow_demo.mjs --base-url=http://127.0.0.1:5173 --min-requests=12