/
Adapter Design

Adapter Design

The TASKANA Adapter syncs tasks between TASKANA and an external workflow system, e.g. Camunda BPM. In this document, we call a task in the external workflow system 'referenced task'.

The adapter periodically performs the following work:

 

  • retrieve new referenced tasks and create corresponding TASKANA tasks
    * retrieve newly created referenced tasks including desired process variables
    * map referenced task to TASKANA task
    * create an associated TASKANA task
    * delete outbox entry for the successfully created TASKANA task

 

  • retrieve finished referenced tasks and terminate corresponding TASKANA tasks
    * retrieve finished referenced tasks
    * terminate corresponding TASKANA tasks

 

  • retrieve finished TASKANA tasks and complete corresponding referenced tasks
    * retrieve finished TASKANA tasks
    * complete the corresponding referenced tasks in the external system

 

  • retrieve claimed TASKANA tasks and claim corresponding referenced tasks
    * retrieve claimed TASKANA tasks
    * claim the corresponding referenced tasks in the external system

 

  • retrieve TASKANA tasks where the claim was cancelled and cancel the claim of the corresponding referenced tasks
    * retrieve cancel claimed TASKANA tasks
    * cancel claim the corresponding referenced tasks in the external system

 

The adapter is structured in an adapter proper that controls the logic and two SPIs:

  • The SystemConnector SPI that connects to the external system and

  • The TaskanaConnector SPI that connects to the TASKANA system.



The component structure of the adapter is as follows

Component

Description

Component

Description

taskana-adapter

The adapter. Implements the sync algorithm and defines the service provider SPIs and APIs for

- SystemConnector (connects to the external system)

- TaskanaConnector (connects to taskana)

These connectors are plugged in at runtime via SPI mechanisms



taskana-adapter-camunda-system-connector

Sample implementation of SystemConnector SPI. Connects to a camunda system via camunda's REST API

taskana-adapter-taskana-connector

Sample implementation of TaskanaConnector SPI. Connects to one taskana system via taskana's java api which accesses the database directly.

taskana-adapter-camunda-listener

Contains a TaskListener, ParseListener, ParseListenerProcessEnginePlugin and OutboxSchemaCreator as client-side components of the camunda-system-connector

taskana-adapter-camunda-outbox-rest

An outbox REST-Service which allows the adapter to query events from the outbox tables, implemented using JAX-RS.

taskana-adapter-camunda-outbox-rest-spring-boot-starter

SpringBoot-Starter in case the REST-Service is used within a SpringBoot-Application

taskana-adapter-camunda-spring-boot-sample

SpringBoot-Application containg the adapter with the sample camunda-system-connector implementation

taskana-adapter-camunda-wildfly-example

Example that can be deployed on Wildfly and contains the adapter with the sample camunda-system-connector implementation

taskana-adapter-camunda-listener-example

Example Process-Application that can be deployed to camunda

camunda-outbox-example-boot

SpringBoot-Application containing camunda and the outbox-rest

taskana-adapter-camunda-spring-boot-test

SpringBoot-Application containing camunda, the adapter and the outbox REST-Service to test a complete scenario with automated integration tests

 

Notes

 

  1. Variables
    When the adapter finds a referenced task for which a TASKANA task must be started, it retrieves desired variables of the referenced task's process. These variables are stored in the custom attributes of the corresponding taskana task in a HashMap. The names of the variables, prefixed with “camunda:” (e.g. camunda:someVariable) will be the keys. The prefix is used to determine which custom attributes of the TASKANA task should later be played back to camunda . The values are of type String and contain the JSON representations of the variables.

  2. Workbaskets
    Task / workbasket mapping has been kept to a minimum. The workbasket for the tasks can either be declared as a process variable (see “Information mapping from Camunda BPM to TASKANA” here ) or the task routing SPI can be implemented to apply custom routing logic (see here)

Related content

TASKANA Adapter
TASKANA Adapter
More like this
Camunda BPM Connector
Camunda BPM Connector
More like this
TASKANA Connector
TASKANA Connector
More like this
Sample topology
Sample topology
More like this
Adapter Properties
Adapter Properties
More like this
TaskanaTaskListener
TaskanaTaskListener
Read with this