Mapping
Context
With transformation, you can apply simple mapping rules to the event messages managed by SAP Cloud ALM. This allows you to transform the content of the incoming event payload and map the data to the format that is required by the target end-points. The mapping is also used to translate the response received from the external system into the format expected by SAP Cloud ALM.
Complex transformations cannot be supported by the built-in transformation mechanisms delivered by SAP Cloud ALM. In that case, you need to use an external API integration platform.
-
Description: Description of the mapping
-
Version: Version of the mapping
-
Source: Description of the source system
-
Destination: Description of the destination system
-
Mapping Type: Transformation logic to apply either rule-based (default) or payload-based
-
Mapping Rules: Transformation rules for message payload
Delivered SAP Cloud ALM mapping rules are marked as "Built-in" and can not be changed in your environment. They can be duplicated to be used as template.
The format of the mapping rules content depends on the selected mapping type.
Integration of a New System
To use the SAP Cloud ALM mapping transformation rules with a new system, please check that the target system supports the following prerequisites:
-
The system must expose REST APIs for external resources manipulation (GET, POST, ...).
-
The system must support a compatible payload with the following SAP Cloud ALM basic mapping rules defined in this chapter.
-
Mapping supports only one payload per REST operations.
-
Mapping rules are limited to:
-
Attributes matching
-
Placeholder expression
-
Switch expression
-
-
-
The external system must be accessible from the SAP BTP customer account with a BTP destination to the remote system with a supported authentication method (ex: OAuth2). Check the webhook documentation to get a list of supported authentication protocols by the SAP Business Technology Platform.
Mapping Definition
-
Description: Description of the mapping
-
Version: Version of the mapping
-
Source: Description of the source system
-
Destination: Description of the destination system
-
Mapping Type: Transformation logic to apply either rule-based (default) or payload-based
-
Mapping Rules: Transformation rules for message payload
Mapping rules that are delivered by SAP Cloud ALM are marked as Built-in and you cannot change them here. However, you can duplicate them to use them as a template.
The format of the mapping rules' content depends on the selected mapping type. The entered content is validated by external API Management.
Operation Mapping
In the mapping content, the different HTTP operations are described within the property eventTypeMapping: the list of operations is provided in the array operationMappings.
|
Property |
Available in rule-based Mapping |
Available in payload-based Mapping |
Type |
Mandatory |
Description |
Example |
|---|---|---|---|---|---|---|
|
displayUrl |
X |
X |
JSON Object |
Configuration details to build on-the-fly the display URL; relies on the 2 nested properties propertyName (property name to use in the transformed response) and relativePath (relative path to use for display URLs) |
|
|
|
eventType |
X |
X |
String |
X |
Configured event type name |
"EVENT-SITUATION.CREATED" |
|
externalIdProperty |
X |
X |
JSON Pointer (String) |
Location of the external ID property in JSON response payload. The location is relative to the responseRoot. |
"/sys_id" |
|
|
headers |
X |
X |
JSON Object |
Section to define specific header values e.g. the HTTP header Content-Type with the property mediaType |
|
|
|
operation |
X |
X |
String |
X |
Operation or HTTP verb to call |
"POST" |
|
path |
X |
X |
String |
Path to the external resource API (including URL parameters) to concatenate to the webhook relative path |
"/api/now/v1/table/incident" |
|
|
request |
X |
JSON Object |
Specific request payload for the operation |
|
||
|
response |
X |
JSON Object |
Specific response payload for the operation |
|
||
|
responseRoot |
X |
X |
JSON Pointer (String) |
Root node from which the response should be read |
"/result" or an empty string if the entire JSON payload can be used |
|
|
sentIf |
X |
X |
String |
Property value defined with a boolean expression. If the value is evaluated as true, the outbound notification is sent. If the value is evaluated as false, the outbound notification is blocked and a message is shown in the Console. If the expression can't be evaluated, the 'sentIf' property is ignored and the outbound notification is sent anyway. |
"sentIf": "#{tags.status == 'FATAL'}" |
|
|
staticResponse |
X |
Boolean |
Property value set to true to define a static response content for the operation without performing an outbound call. The static content should be defined with the other property 'response'. |
true |
||
|
structure |
X |
JSON Object |
Specific structure for the operation |
|
Mapping Context
The following variables can be used in the payload-based mapping and will be replaced at runtime during the transformation mapping:
|
Variable |
Syntax within Expression |
Output Example |
Notes |
|---|---|---|---|
|
SAP Cloud ALM tenant |
#{@CLOUD_ALM_TENANT_NAME} |
"internal-demo" |
|
|
SAP Cloud ALM URL |
#{@CLOUD_ALM_URL} |
"https://internal-demo.eu10.alm.cloud.sap" |
|
|
SAP Cloud ALM user |
#{@CLOUD_ALM_USER} |
"test.example@sap.com" |
|
|
Stored External ID |
#{@CLOUD_ALM_EXTERNAL_ID} |
"123" |
Stored external ID of the resource. This variable is set if the externalIdProperty property has been defined in the response mapping of a creation event.
Example: The externalIdProperty is mapped to the property id returned by the external service:
The externalIdProperty relies on JSON Pointer syntax. |
|
User Variable |
#{@USER_VAR(<variableName>)} |
"PRJ" |
The end user can refer for example to the variable name projectKey using the syntax #{@USER_VAR(projectKey)}. At runtime, it will be replaced by the configured value or an empty string if the variable name is not defined in the subscription. |
|
SAP Cloud ALM external reference |
#{@CLOUD_ALM_EXT_REFERENCE(<externalReferenceName>)} |
"123" |
As input, the name of the external reference should be specified. The generated output is either the external reference ID or an empty string if the external reference name is unknown. This environment variable is intended to be used with resource types which include the property externalReferences in their payloads. The generated output is an empty string if the resource type is not relevant. |