Integration Builder

Compose Enterprise is going through a design update. The illustrations on this page might be of the old design, but the information is up to date. Thank you for your patience during this update!

Norsk

Compose provides you with the possibility to populate form answers using an integration. Any external service that accepts and produces XML or JSON data can be used in Compose through this builder. The external service is represented as a set of request and response variables towards the workflow, where they can be mapped to e.g. question answers. The request is formatted using the same principles as in Text Generators - using input variables it is possible to tailor the request format to the needs of the given external system. The data retrieved from the external service is parsed, and response variable values are extracted using XPath expressions that are configured in the Integration Builder.

The Integration Builder consists of four main sections; Settings, Request headers, Request and Response. Before entering the Integration Builder you need to create a new or open an existing integration (see the https://composetogo.atlassian.net/wiki/spaces/CNGD/pages/1835220 documentation).

Settings

The Settings section consists of a Versions panel, a Properties panel, a Request Variables table and a Response Variables table. Both Request- and Response variables have their own Properties menu accessed by double-clicking on them.

Versions

Versions 

Versions 

Start to edit from selected version 

Your draft settings will be overwritten with the settings from the selected version.

View selected version

Select a previous version and view the settings/script in a read-only view.

New version

Version the integration to use it in a workflow.

Properties

Properties

Properties

URL

The Service will use the entered URL when running. The URL input field can also be parameterized using {} notation. (This can be useful for instance in cases where organizational information is provided through a URL and where the information provided is based on organizational number. By adding the organizational number as a parameter {orgnr} in the URL, you can look up organizational information with an organizational number entered by a respondent.)

Note: Special characters like æ, ø, å, /, % are encoded when added to the endpoint URL as variables. Therefore, request variable values with % characters will be encoded, and should be avoided.

Method

Compose integration provides the following methods: GET, PUT, POST, DELETE. Note: For GET requests – based on the HTTP standard – using a request body is not supported.

Request Variables

Properties

Properties

Create

Pressing the Create button, creates a new request variable. When you have entered a name and pressed OK, the variable will appear in the list of variables. When a Request Variable has been created it is possible to enter a transformation script by pressing the Transformation script button for each variable. Note: The variable name can't e.g. start with a capital letter, contain white-space characters and must have a length of 1 to 40 characters.

Delete 

Request variables can be deleted by selecting the variable you wish to delete, then pressing Delete.

Modify

When a request variable is selected you may press Modify to view/edit the variable properties. See table below.

Request Variable - properties

Variable Properties

Variable Properties

Name

This is a unique name of the request variable that will be accessible to the request script. 

Type

This can be either Data type variable typeFile based data type variableForm answer based or Option source variable. If you wish to send File information, e.g. file uploaded to a form, please select the File based data type variable. For more information about methods available for file data type validation script, check out https://composetogo.atlassian.net/wiki/spaces/CNGD/pages/1835174.

Validation

Choose a validation from the dropdown (except for Form answer based type variables). The validations differ based on chosen type.

Calculated

A request variable can be transformed through calculation. If Calculation is chosen it is mandatory to add a transformation script. For normal variables, it is not possible to use a transformation script based on other variables. You therefore have to use a calculated variable if you need to include other variables in your transformation script. Note: A calculated variable can only reference non-calculated variables in their transformation script.

Example: Calculated response variable

For this example we have two request variables named x and y. The variable x is an integer based non-calculated variable and variable y is an integer based calculated variable.

For this example we want to calculate the value from variable x + 10. To do this we open the Transformation script for variable y and simply enter the script: x+10

Response Variables

Properties

Properties

Data format

Choose between XML, JSON and Binary to disclaim the format/language of the data model you’re retrieving information from.

Create

Pressing the Create button, creates a new response variable. When you have entered a name and pressed OK, the variable will appear in the list of variables. Note: The variable name can't e.g. start with a capital letter, contain white-space characters and must have a length of 1 to 40 characters.

Delete 

Created integration response variables can be deleted by selecting the variable you wish to delete, then pressing Delete.

Modify

When an request variable is selected you may press Modify to view/edit the variable properties. See table below.

Response Variables - Properties

Variable Properties

Variable Properties

Name

Unique name of the response variable that will be accessible to the generation script. 

Type

 This can be either Data type variable or Option source variable. Option source response variables are exclusively for populating options. For all other scenarios data type variables would be used (data type builder validations, form population etc).

Validation

This can be String, Integer, Decimal or Date. Changes in the data type have to correspond with the form question connected to the input variable.

CCM Integration

The CCM Integration check box and End Point URL is only used for publishing workflow data to a Compose Case Management (CCM) instance. Providing an End Point URL publishes workflow data to a CCM when versioning the workflow. In that way, the workflow can be configured in the CCM and reflect the workflow data before a case record is sent into the CCM.

Request Headers

Script

Script

Create 

Create a new request header.

 

Name

Enter a name for the request header. 

 

Value

If your integration integrates toward a private API or any register where authentication is necessary, this field will need to contain the authentication key.

Delete 

Remove a request header. 

Request

Script

Script

Script

Enter the preferred script used for request variables.

Syntax highlight

Select the syntax highlight corresponding with the script you wish to enter. Your choices for syntax highlighting is Groovy, JSON, HTML, XML, Plain Text and YAML.

Validate

The script may be validated, to search for errors in the script. Script validation will give you feedback on whether the script passed or failed. An error message will help you find the errors, if your script failed. These errors need to be corrected to version the integration.

Response

Script

Script

Name

Selected name will be displayed here

Type

Selected data type will be displayed here.

Expression

For each response variable you need to specify a XPath expression. Pay attention to the data types and that the XPath expression should not return an XML node, but a value.

Transformation

The response value can be transformed with a script in the script window accessible through the Transformation button. The response value is referred to as value. The script is influenced by whether there is an XPath expression or not. If not, value represents the entire XML response that we get from calling the URL. Otherwise value represents the specific part of the document which the expression maps to. Note: If the expression is left empty it would be possible to write a complicated script to do whatever you want and return the desired value from transformation scripts.