Customizing default workflows

Customizing workflows allows organizations to tailor business logic to their specific needs. This page explains how to modify user task options in the UI, override service task behavior, and exclude variables from workflow histories.

Prerequisites

Before customizing workflows, ensure you have:

  • Familiarity with BPMN modeling.
  • Experience with Spring development.

How to modify the user task options in the UI

User tasks in the default workflows are defined using YAML configuration. These definitions control the options shown in the UI.

To customize them:

  1. Open the application.yml file.
  2. Navigate to the activeviam.apps.workflow-service.workflows section.
  3. Locate the actions property under the relevant workflow.
  4. Add, remove, or modify the actions as needed.

Changes to this configuration will automatically update the UI.


How to modify what happens when a service task executes

Each workflow includes service tasks that trigger Spring beans. These beans implement logic for automated steps.

To override a service task:

  1. Identify the bean name used in the workflow documentation.
  2. Define a new Spring bean with the same name.
  3. Ensure it is exposed to the Spring context.

Example: Override a service task

To replace the logic after a six-eyes approval with a simple log message:


@Bean
public Connector postSixEyesLimitApproval() {
  return integrationContext -> {
    log.info("Notifying users of six-eyes approval.");
    return integrationContext;
  };
}

How to ignore variables in the workflow histories

Variable changes in the workflow histories, visible in the UI for limits and incidents, can be ignored by including the variable in the activeviam:apps:workflow-service.settings.ignored-history-variables property value.


What services are available for interacting with the workflows?

The following java services are available for interacting with the workflows.

1. ILimitsWorkflowService

  • Contains Atoti Limits specific methods to start limit and incident workflows.
  • Executes user tasks and fetches limit and incident histories.
  • Invokes the workflow service code.

2. IWorkflowService

  • Provides generic methods for interacting with the underlying workflow-service.

3. LimitsWorkflowAspects

Uses Aspect Oriented Programming (AOP) with Spring to intercept method calls and redirect to the workflow service.

  • Enables integration with the workflow service without modifying the existing codebase.
  • Supports both old and new workflows.
  • Decouples workflow-related code from product-related code.
  • Allows clients to add custom workflows.

info

We don’t expect you to customize LimitsWorkflowAspects, but it may be a useful reference if you wish to implement your own aspects