Process as business logic

Instead of the previously used model, in which control flow and business rules are embedded in code (e.g., in the form of conditional statements, loops, or service calls), using a BPMN process allows transferring this responsibility to a process defined as a graphical diagram.

Such a process is the central “coordinator” of case processing in the system, which controls which steps should be performed, in what order, and what decisions to make based on input data and intermediate results. This makes it possible to model how a case is handled in a clear and maintainable way.

This approach brings a number of benefits:

  • Clarity and understandability - the process logic is recorded in a more accessible graphical notation, making it easier to understand its flow and to collaborate on its shape and development.

  • Increased flexibility - modifications to business logic can be introduced faster, without the need to change code and redeploy the application.

  • Better monitoring and auditability - every process started in Camunda is recorded in the history. Events and incidents can be analyzed, which greatly facilitates debugging and analyzing the system’s behavior.

The definition of business processes includes elements that allow mapping business logic in the form of a process, such as

  • User Task (User task) - User tasks are used to involve people in the process flow. They can be assigned to specific individuals, roles, or user groups. They enable activities such as approvals, data entry, manual decisions, or information verification.

  • Service Task (Service task) - Service Task enables the system to perform an automated action without human participation. This can be calling an external API, a script, a REST or SOAP service, or another technical component.

  • Gateway (Decision gateways) - gateways are used to control the process flow depending on the fulfillment of logical conditions. They allow modeling business rules that determine which path will be chosen based on process data.

  • Script Task (Script task) - allows performing simple operations on process data (e.g., transformations, calculations) using a scripting language (e.g., JavaScript, Groovy). Recommended only for simple operations – business logic should, as far as possible, be moved to external components.

Last updated

Was this helpful?