Skip to content
gawie-yssel edited this page Jul 6, 2021 · 2 revisions

Linx solution structure

The solution uses folders to group related functionality. Here is a brief explanation of what each folder does.

Camunda

The Camunda folder contains all the interaction with the Camunda workflow engine. Entities outside of this folder should not call Camunda directly.

Folders inside the Camunda folder matches the endpoints on Camunda's REST API.

The AllVariables type contains all the variables available to Camunda in the workflow process. A variable of this type is used to pass the values to the workflow engine when calling the REST endpoints.

Tasks

The Tasks folder contains a function for each Service Task in the BPMN diagram. The Workers.DoTask function calls these functions when instructed by the workflow engine to do so.

Task functions should be idempotent i.e. they should have the same result even if executed more than once.

Tests

The Tests folder contains all the test functions. Names of test functions start with 'Test'. The other functions are all there to assist the test functions.

UI

The UI folder contains an API to support a user interface. The sample BPMN diagram contains a single User Task. Instances of these tasks can be retrieved and completed through the API.

Functions CompleteTask and GetTasks have been extracted from the API.CompleteTask and API.GetTasks events so that they can be tested.

Workers

The Workers folder contain two Timer Services that drives the process.

CheckForFilesTimer checks for new files and starts a new workflow instance for each file found.

CheckForWorkTimer asks the workflow engine for external tasks to execute. For each task the engine returns it calls a function in the Tasks folder and marks the task as complete once done.

Functions StartWorkflowForFiles and CompleteWorkflowTasks have been extracted from CheckForFilesTimer.TimerEvent and CheckForWorkTimer.TimerEvent so that they can be tested.

Clone this wiki locally