General principles

This page provides details of how the customizable workflow objects are set up in the Sign-Off Module.

Starter Module

The signoff-starter maven module is designed to be the starting place for most customizations. Some more advanced customization may also need to change the signoff-activeviam maven module.

Object Management

The Sign-Off Module is built around managing server-side objects as they progress through Business Process Management (BPM) workflows.

In the Sign-Off Module there are two types of objects being managed:

  • Sign Off Process Definition
  • Sign Off Process Instance

Each object type, comes with:

  • JPA Entity and DTO implementations of the object (sharing a common interface)

  • A service for managing the persistence of the DTO objects, backed by a JPA repository.

  • A Workflow Service that interacts with the Activiti workflows to manage the DTO objects.

    The workflow service provides methods aligned to the actions within the workflows. Hence it is expected that the workflow service will be customized alongside the workflows.

See Customizing the sign-off backend

Activiti workflows

The BPM Process Engine used in the Sign-Off Module is Activiti. It reads definitions from .bpmn files and is able to manage workflows based on these definitions.

For each object type there can be multiple workflows that can be used for managing the objects. These are all defined in the .bpmn files.

For details on working with .bpmn files, see the Activiti documentation

Workflow Service

The Workflow Services provide an interface into the Activiti workflows. The workflow services implement interfaces that are used to control the workflows, these interfaces contain two types of methods:

  • Start workflows

    Examples:

    • Create (sign-off process definition)
    • Initiate (sign-off process instance)
  • Send user actions to the workflows

    Examples:

    • Publish (sign-off process definition)
    • Approve (sign-off process instance)

Additionally, the workflow services contain Spring beans that can be called from within workflows to implement service tasks.

Utility Methods

A few utility methods are provided to help implement the two method types above.

Method Description
startProcess Starts a new Activiti process instance.
taskStateTransition Sends a user action to the workflow instance so that the workflow can transition to the next state.
signalEvent Sends a signal to the workflow.

Rest Controller

Thin wrapper around the workflow service. The REST API matches the API in the workflow service, and all REST calls are passed straight through to the service.

The UI can use the REST API to start processes and send user actions to the workflows.

For example, the Approve button in the UI, will call the “approve” REST endpoint on the sign-off process instance REST Controller, which will call the “approve” method on the sign-off process instance workflow service, which will send the “approve” action to the workflow.

For UI settings, see Customizing sign-off workflow UI