Centralised Configuration Component for the BPM Engine

Available since version 6.2.0-Xenon

Introduction

This allows you to obtain a Centralised Configuration of Onesait Platform from BPM Engine, so you can use this information in other tasks.

How it works

To use this new functionality, you will have to access the editing view of the BPM diagram and create a new task (Task), to which the ‘Onesait Platform Centralized Config’ template will be indicated:

image-20241211-110534.png

The next step is to configure the task, specifying the following properties:

  • Timeout: The time in milliseconds before launching a Timeout.

  • Platform Environment: Here you will have to indicate the URL of the environment from which you want to obtain the centralised configuration.

  • X-OP-APIKey: The X-OP-APIKey of the environment from which the configuration is to be obtained must be added.

  • Configuration Identification: The configuration identifier must be indicated.

After configuring the task, as well as the rest of the BPM, just save the changes and deploy the model by clicking on the ‘New BPM Deployment’ button:

The BPM Engine is then accessed by clicking on the eye button in the ‘BPM Domains’ area:

Once inside the BPM Engine, click on the house icon (top right) and then on ‘Tasklist’:

After this, click on ‘Start Process’ on the process assigned to the BPM:

After executing the process, the centralised configuration can be viewed by clicking on the ‘House icon > Cockpit > Running Process Instances’ and finally on the BPM Key.

In the next window you can see the BPM variables, where you can see the configuration selected in the task, which can be used to obtain information and use it in other tasks.

Example of use

The following example will show how to use the data received from the task. To start with, the following configuration will be used:

{ "valorString": "String1", "valorNumber": 12345, "valorBool": false, "valorObj": { "valor1": "HolaMundo", "valor2": 987, "valor3": true }, "valorString2": [ { "valorArray1": "array1", "valorArray2": "array2" }, { "valorArray3": "array3", "valorArray4": "array4", "valorArray5": { "valorObjectArray": "valor5", "valorObjectArray2": "valor6", "valorObjectArray3": [ { "valorRecondito": "recondito", "valorRecondito2": "recondito2" } ] } } ] }

The data can be retrieved from a Script Task or from the ‘Outputs’ field.

In the case of retrieving values from a Script Task, the following properties shall be indicated:

  • Type: the ‘Inline script’ must be selected.

  • Script: the script necessary to obtain the desired value shall be written.

  • Result variable: the name of the variable with the data obtained from the script.

The values obtained in this example would be as follows:

  • stringValue: ${opconfig.prop(‘stringValue’)}

  • valueNumber: ${opconfig.prop(‘valueNumber’)}

  • valueObj.value1: ${opconfig.prop(‘valueObj’).prop(‘value1’)}

  • valueString2.valueArray5.valueObjectArray3.valueRecond: ${opconfig.prop(‘valueString2’).elements()[1].prop(‘valueArray5’).prop(‘valueObjectArray3’).elements()[0].prop(‘valueRecond’)}

In the following image you can see, from Camunda, how the variables arrive with the data we wanted to obtain: