CPI iFlows

Cloud Platform Integration (CPI) is a method of integrating a variety of systems together over the SAP Integration Suite. Flows are collections of nodes that perform integration operations together.

Simple Expression Language

Camel brings a feature named Simple Expression Language, which can be used to parameterize Exchange Parameters of a message. It’s scheme is as simple as a dollar-sign and a curly brace which surround the respective parameter: ${<param>}

It allows the combination with operators to produce boolean expressions and is therefor commonly used to access an exchange message’s properties and use them for routing or calling OData services.

Dynamic OData call

$select=ToHeader/CustomerID,ToHeader/CustomerName,ToHeader/DeliveryStatus&$expand=ToHeader&$filter=SalesOrderID eq '${property.SalesOrderID}' and ItemPosition eq '${property.ItemPosition}'

SEL comes with several built-in variables. Camel maintains a list of all these but only a subset are available in SAP CPI:

VariableDescription
idThe ID of the message
exchangeIdThe ID of the exchange
bodyThe payload of the input message
header.<name>The contents of the named header
property.<name>The contents of the named exchange property
date:command:patternDate and time formatting. More details
date-with-timezone:command:timezone:patternDate and time formatting in a specific time zone (more details below)
messageHistoryThe history of how this exchange was processed
messageHistory(false)Similar to messageHistory, but without the contents of the exchange
camelContextProvides access to the Apache Camel runtime
exception.messageThe text of the current exception (or null if there’s no exception)
sysenv.nameThe contents of the named environment variable
It also supports operators, for example to route messages
// Check for greater than properties
${property.MyNumericProperty} > '0'
 
// Check for substrings
${property.MyStringProperty} contains 'test'
 
// Check for regex
${property.ProductCode} regex '^[a-z]{5}\d{3}$'
 
// Work with arrays and maps
${property.MyList[0]}
${property.MyList[last-1]}
${property.MyMap[key]}

Find more examples on this SAP blog article

XPath

XPath is an expression language to target nodes inside an XML document. Simiar to SEL, it helps navigating through XML document nodes in a standardized manner.

Demo webapp

You can find a simulator for XPath expressions here

Message Mapping

Message mapping is used to transform source data formats into target formats. SAP CPI includes several methods of implementing message mapping.

Mapping TypeDescription
Graphical MappingGraphical mapping of source to data structures
Operation MappingOperation Mappings imported from legacy SAP PO systems
Script MappingScript mapping is available using Groovy or Javascript scripts
XML Schemata (XSD)Describes the structure and content of XML documents
XSLT MappingUsed for more complex XML-based mapping requirements

iFlow Components

iFlows consist of components and nodes. Components are senders, receivers and lanes. Nodes are process steps, such as events, routing or changing the message content.

Participants

Participants can also be Open Connectors

NameDescription
ReceiverRecipient of the outbound message
SenderSender of the inbound message

Process

NameDescription
Exception Sub-ProcessHandling of unexpected errors during flow execution. Started with a Error Start Event
Integration ProcessA default cloud iFlow. Started with a variety of start events, such as HTTP-In, Timer
Local Integration ProcessSub-Processes that can be used to modularize process steps. Can be called by Integration Process using Process Call step

Event

NameDescription
(Message)End EventEnds a message processing sequence
Error End EventEnds a message processing sequence and propagates errors to the main process. Usually used in Exception Sub-Processes to propagate the error
Error Start EventUsed at the beginning of an Exception Sub-Process. Can be configured to react to specific or all errors.
Escalation Start EventTerminates the process where is was called and propagates the error to the parent. Does not interrupt the parent process
Start EventMarks the beginning of a process. Commonly used in Local Integration Processes
Start MessageMarks the beginning of an inbound message flow. Commonly used to start Integration Processes using SOAP, HTTP, TPC
Terminate MessageStops the processing of a message and propagates status Failed
TimerMarks the beginning of a timed process (Job / Schedule)

Mapping

See Message Mapping

NameDescription
ID MappingGenerates a unique ID for a combination of source message ID and a provided context. This effectively marks messages as possible duplicates. Example
Message MappingConvert a message source data structure to a target structure using a mapping artifact
Operation MappingLegacy mapping from PI/PO
XSLT MappingTransform more complex messages from one XML structure to another. Uses XSLT Schemata to work properly.

Transformation

NameDescription
Content ModifierSet message header, properties or body to static or dynamic values
ConvertersConvert between different message types, such as JSONXML, XMLCSV
DecodersDecode Base64, GZIP, MIME Multipart and ZIP
EDI ExtractorExtract specific data elements from EDI documents
EncoderEncode Base64, GZIP, MIME Multipart and ZIP
FilterFilter out a particular set of nodes that does not match XPath expression
Message DigestCreates a hash value from the message payload and stores it in a header
ScriptExecutes Groovy or Javascript code on the message
XML ModifierRemoves XML declarations, external DTD and invalid XML characters

Call

NameDescription
External CallCall an external resource, with Request Reply, Polling or Send
Local CallCall an internal resource, such as a Sub Process

Message Routing

NameDescription
AggregatorCombines a number of messages into a single XML message over multiple flow executions
GatherCollects messages from, multiple senders and combines then within a set time window
JoinCombines data from parallel branches in a single flow execution
MulticastSends the same message to one or more parallel branches
RouterSends an exclusive message to one specific flow based on a condition
SplitterA collection of steps to break down message payloads into multiple messages

Security

NameDescription
DecryptorDecrypt data from inbound messages
EncryptorEncrypt data for outbound messages
SignerCreate a digital signature for an outbound message
VerifierVerify a digital signature from an inbound message

Persistence

NameDescription
Data Store OperationsExecute CRUD operations on the tenant database. Default Temp Storage time is 30 days
PersistStores the entire message in the tenant database. Stored messages are accessible using the Cloud Integration OData API
Write VariableStore variables for longer-term use. Accessible under “Manage StoresVariables’

Validators

NameDescription
EDI ValidatorValidates an inbound EDI message against multiple defined schema
XML ValidatorValidates an inbound XML message against a defined XML schema

Data types

NameDescriptionExpression
StringText datajava.lang.String
BooleanTrue/false valuesjava.lang.Boolean