setting up Activiti BPMN Workflow Engine with Spring Boot - 指南

spring.activiti.database-schema-update: true

  • Controlshow Activiti handles its database tableson startup.

  • Options:

    • true – Default. Creates or updatestables automatically if missing. ✅ Good fordevelopment.

    • false – Disables auto-update. Throws an error if tables are missing or version mismatch. ❌ For production.

    • create_dropCreates tables on start and drops them on shutdown. ⚠️ Risky, only for testing.

    • drop-create – Drops existing tables and creates new ones every time app starts.


spring.activiti.db-history-used: true

  • EnablesActiviti's history tables.

  • These store past process execution info (like who approved what and when).

  • Without this, even with history-level set, no history tables are created.


spring.activiti.history-level: full

  • Defineshow much historyActiviti saves.

  • Options:

    • none – No history (best performance).

    • activity – Saves basic activity instance data.

    • audit – Adds task infolike who did what.

    • full – Saves everything, including variables and execution details. ✅ Best fordebugging/auditing.


spring.activiti.check-process-definitions: false

  • Whether toautomatically scan and deploy BPMN process files from resources/processes/.

  • false – You must manually deployprocesses (e.g., via code or REST).

  • ✅ Useful when youdon’t want automatic redeployments(e.g., in production).


spring.activiti.deployment-mode: never-fail

  • Controlsdeployment conflict handling:

    • default – May fail if process definition is already deployed.

    • single-resource – Deploys each file separately.

    • never-failIgnores duplicate deployments, avoids errors.

  • ✅ Safer option toprevent deployment exceptionsduring startup.


spring.activiti.async-executor-activate: false

  • Controlswhether the async executor is started.

  • Async executor handlesasynchronous jobs and timersin workflows.

  • false – Disables it.

  • ✅ Disable if you don’t use timers/events to avoid unnecessary thread usage.


✅ Summary (recommended for dev)

SettingValueMeaning
database-schema-updatetrueAuto-create/update tables
db-history-usedtrueEnable history tables
history-levelfullSave full execution history
check-process-definitionsfalseDon’t auto-load BPMN files
deployment-modenever-failAvoid deployment errors on startup
async-executor-activatefalseDon’t start async job processor
posted @ 2025-07-20 17:25  yjbjingcha  阅读(17)  评论(0)    收藏  举报