Case study · Ruizhi Rongke · 2016-12 — 2017-07
Lightweight OA Workflow Engine
A reusable tree-based workflow engine for conditional, parallel, transitional, and rollback-aware approval paths.
Role · Designer and implementer of the workflow engine core
- Python
- Django
- MySQL
- Workflow orchestration
01
Overview
- Context
- Internal and client approval systems needed configurable workflows instead of hard-coded approval paths.
- My contribution
- Designed the workflow model and implemented the reusable engine core.
- Technology
- Python, Django, MySQL, and explicit workflow orchestration.
- Result
- Applied the engine to internal and client systems and documented its design publicly.
02
The Problem
Approval products needed conditional branches, parallel gateways, transitions, and rollbacks without coupling every rule to one product's forms.
03
My Role
Designer and implementer of the workflow engine core
- Designed a tree-based workflow representation with explicit nodes and transitions.
- Implemented the engine with Django and MySQL.
- Applied the reusable core to internal and client approval systems.
04
Architecture
A focused map of the components and responsibility boundaries that matter to this project.
Component map
Reusable workflow-engine model
- 01Approval request
Product-specific form and input
- 02Tree engine
Reusable workflow rules
- 03Branching nodes
Conditional and parallel paths
- 04Transitions
Explicit movement between nodes
- 05Persisted state
Execution history and rollback support
Approval requestTree engineinputTree engineBranching nodesevaluateBranching nodesTransitionsadvanceTransitionsPersisted statepersist
A product-specific request enters a reusable tree-based engine. Explicit nodes represent conditional and parallel paths, transitions persist execution state, and that state supports rollback. Product forms remain outside the engine core. - 01Approval request
05
Key Technical Decisions
- Problem
- Scattered product conditionals made complex approval paths difficult to reason about.
- Choice
- Represent workflows as a tree of explicit nodes and transitions.
- Why
- Conditional paths, parallel gateways, and rollback behavior could share one visible domain model.
- Trade-off
- The engine required explicit state-transition rules instead of relying on simple linear form status.
- Problem
- Embedding form-specific behavior in the engine would limit reuse.
- Choice
- Keep the workflow core separate from product-specific approval forms.
- Why
- The same orchestration model could support multiple internal and client systems.
- Trade-off
- Products needed a clear integration boundary for supplying inputs and handling workflow output.
06
Challenges
- Expressing conditional and parallel behavior without scattering workflow rules across product code.
- Preserving enough state to support explicit transitions and rollback behavior.
07
Outcome
- Used the engine in internal and client approval systems, including a GF Securities project.
- Documented the core design concepts in a public technical article.
08
What I Learned
- Learned
- A small explicit domain model made complex approval paths easier to understand than scattered product conditionals.
- Reflection
- The public article preserves the reusable design concepts while the case study keeps client-specific implementation details private.
This was an employer-owned production system. Architecture and implementation details shown here are simplified to protect confidential information.