Using the service
After you deployed the CMS service in your infrastructure, you can start defining and using custom content types, such as different lists (which can have different values for the same code depending on the external system that is used), blog posts etc.
You can also set the default application name to be used in your configuration. This is needed when retrieving the contents.
1
application:
2
defaultApplication: DEFAULT_APPLICATION_NAME
Copied!
If this configuration is not set, the service will use flowx as the default value.

Define needed Kafka topics

Kafka topic names can be set by using environment variables:
  • KAFKA_GET_CONTENTS_IN_TOPIC_NAME
  • KAFKA_SEND_CONTENTS_IN_TOPIC_NAME
The Engine is listening for messages on topics with names of a certain pattern, make sure to use an outgoing topic name that matches the pattern configured in the Engine.

Enumerations

Used to manage a list of values that can be used as content in UI components or templates. Values can be defined for specific languages or source systems.
For each entry in an enumeration we have to define:
  • code - not displayed in the end-user interface, but used in order to assure value uniqueness
  • labels - strings that are displayed in the end-user interface, according to the language set for the generated solution
  • external systems codes - values that are set for each external system that might consume data from the process; these codes are further used by connectors, in other to send to an external system a value that it can validate
Enumerations can also be defined as a hierarchy - for each entry we can define a list of children values (eg. name of the countries defined under the continents enumeration values); hierarchies further enable cascading values in the end-user interface (eg. after selecting a continent in the first select UI component, the second select component will contain only the children of this continent).

Example: Request a label by language or source system code

Used to translate custom codes into labels using the specified language or a certain source system.
Various external systems and integrations might use different labels for the same information. In the processes it is easier to use the corresponding code and translate this into the needed label when necessary: for example when sending data to other integrations, when generating documents, etc.
You will need to add a Kafka send event in your process definition using the FlowX Designer in order to make a request to the CMS service.
The following values are expected in the request body:
  • at least one of language and sourceSystem should be defined (if you only need the sourceSystem to be translated, you can leave language empty and vice versa, but they cannot both be empty)
  • a list of entries to be translated
Example:
1
{
2
"language": "en-US",
3
"sourceSystem": "CS"
4
"entries": [
5
{
6
"codes": [
7
"ROMANIA",
8
"BAHAMAS"
9
],
10
"contentDescription": {
11
"name": "country",
12
"application": "flowx",
13
"version": 1,
14
"draft": true
15
}
16
}
17
]
18
}
Copied!
If the value for application is not sent, the defaultApplication value will be used when retrieving the contents from database.
version and draft are not mandatory, if they are not specified, the latest published content will be used.
The service will respond with the following message structure:
1
{
2
"entries": [
3
{
4
"code": "ROMANIA",
5
"label": "ROMANIA -en"
6
"translatedCode": "ROMANIA-CS"
7
},
8
9
{
10
"code": "BAHAMAS",
11
"label": "BAHAMAS -en"
12
"translatedCode": "BAHAMAS-CS"
13
}
14
],
15
"error": null
Copied!

Substitution tags

Used in order to generate dynamic content across the platform.
As enumerations, substitution tags can be defined for each language set for the solution. In order to add a substitution tag, we have to define:
  • key
  • values - strings that are used in the end-user interface, according to the language set for the generated solution
Last modified 7mo ago