Kap 01 - Concepts and Use of Content Modifier
Kap 01 - Concepts and Use of Content Modifier
Content Modifier is simple but one of most important step in CPI that used frequently
the key takeaways for practical CPI usage are:
a) Pipeline concept that CPI pass message contain headers, properties and body
from one CPI step to the next step, connected by arrows. Multiple CPI steps can be
chained together sequentially / parallelly.
c) Generally, header store smaller size data that might need send to
receiver(s)a. E.g. as HTTP headers.
d) Generally, property store larger size data and data need to store in earlier step of
i-flow and need retrieve back at later step.
Attribute Description
Action You can specify whether the Content Modifier should create or
delete the header or property defined by the table row.
You must specify the name of the header or property you want to
delete.
Content Modifier Attributes for Message Header or Exchange Property
Attribute Description
Name Name under which the specified data has to be stored in the
selected header or property data container.
Source Type Indicates the kind of data you want to use to change the content of
the selected header or property data container.
▪ Constant
▪ Header
▪ XPath
Attribute Description
Attribute Description
▪ Local Variable
▪ Number Range
▪ Global Variable
Attribute Description
Default Value If you have selected Local Variable or Global Variable as Type,
the value specified as Default will be assigned to the header
(Only relevant if
value if the variable is not found at runtime.
you have
selected Local
Variable or Global
Variable as Type)
- Go to the Message Body tab, and define the fields as shown below.
Attribute Description
▪ If you add a Content Modifier step without a header, body, and property, you
cannot trace the element.
Example
Let us assume that the incoming message contains the following information content:
<product>
<productId>HT-1051</productId>
<productName>Deskjet Mobile</productName>
</product>
The message contains information about an individual product from a product catalog.
The use case is that this message is to be enriched with the actual system time (as
order time) and transferred into an order message.
In a first content modifier, specify the following settings in the Exchange Property tab:
Parameter Value
Name timestamp
Type Expression
The content modifier stores the time value in the timestamp property.
In a 2nd content modifier, enter the following expression in the Message Body tab:
<order>
<time>${property.timestamp}</time>
${in.body}
</order>
At runtime, the expression ${property.timestamp} dynamically retrieves the
timestamp stored in the previous content modifier.
The expression ${in.body} is replaced by the actual content of the inbound message.
As a result, the final message (after the 2 content modifiers) has the following
content for our example:
<order>
<time>2021-05-19 09:20:56</time>
<product>
<productId>HT-1051</productId>
<productName>Deskjet Mobile</productName>
</product>
</order>
${header.elementname}
${property.elementname}
${in.body}