This workshop provides an example for integrating REST services. The
translation service DeepL
is used for this. When the user saves a text in German, it will be translated
into English and French.
2. Installation
Download the example application here.
Import the downloaded file "advanced-techniques-rest-services-integration.zip"
and select the application and process it contains. Then switch to the
Processes module,
open the process "Advanced Techniques - Integrate REST services"
and activate it.
3. Enter the API key
To use the translation app, an API key is required. This is available from
the DeepL website.
Open the example application in the browser and enter the API key on
the "API key" page. Then click on "Save".
4. Translate
Go to the edit page and enter a text of your choice for the translation.
Then click on "Save".
The translated text is then displayed in the other languages.
5. Process structure
The example process responds via a
data group event handler
to data records added on the edit page in the example application. Afterwards,
the DeepL request is made via the following script in a Groovy script action.
The English and French translation is transferred to the
sharedState in the
variables "enText" and "frText".
In the subsequent data group action,
both variables, as
user-defined system values
from the "Processing context", are mapped to the correpsonding fields
in the example application.