Posts

CSV to XML - Demo

Image
 The converter element enables you to transform an input message in one format to another.  Input: 123, Akshay, CPI Consultant 456, Akshada, Professor CSV to XML Converter : XML Schema: Choose Browse and select the file path to the XML schema file that is used as the basis for message transformation. The XML file schema format is used as the basis for creation of the payload.  Path to Target Element in XSD : XPath in the XML Schema File where the content from CSV has to be placed.  Record Marker in CSV : The corresponding record in the CSV file that has to be considered for conversion. This entry is the first text in every new record of the CSV.  If this value is not specified then all the records would be considered for conversion. Field Separator : If we want to use a field separator that is not available in the dropdown list, manually enter the character in Field Separator in CSV field. If you want to exclude headers in the first line of CSV file for convers...

Message Digest

Image
 Used to calculate a digest of the payload or parts of it and store the result in a message header. We can transform part of the message, enter an XPath expression to specify the part (optional attribute). Can also define a prefix namespace mapping. Hash  Address :  https://refapp-espm-ui-cf.cfapps.eu10.hana.ondemand.com/espm-cloud-web/espm.svc/ Target Header Name: Enter the name of the target header element which is to contain the hash value (digest). This is a mandatory attribute When tested first (without changing anything in the payload), the below MD5 hash was generated : AVWgPTQU1b/X/YC/4ANlwA== -------------------------------- On the second test run, we added a new customer review in the OData WebShop API ( so we get a different response compare to earlier to view the disparity in MD5 Values) Can see below the customer review was added in the Response Payload:  As the response (input to MD5) has been changed, the resulted MD5 hash value should also b...

Filter

Image
When to use Filter? ->  if want to filter information by extracting a specific node from the incoming message. What are different value types? ->  Sample XML Payload: (to put inside Body of Content Modifier) ---------------------------------------- <Message> <orders>  <order>  <clientId>I0001</clientId>  <count>100</count>  </order>  <order>  <clientId>I0002</clientId>  <count>10</count>  </order> </orders> </Message>  ------------------------------------------------- iFlow: Content Modifier: With value type as ' Integer ' With value type as Boolean : With Value type as 'Node' : (only first occurrence of node is considered) With Value type as 'Nodelist'  (All <count> nodes are considered )

Receiver Mail Adapter - Basics

Image
  Address :  Specifies the host name and (optionally) a port number of the SMTP server.  Use one of the following open ports for external mail servers:  25 and 587 for SMTP+STARTTLS 465 for SMTPS If you are using GMail Server, make sure that you allow insecure applications (GMail considers only communication based on OAuth2 as secure) when configuring the server.  Can use port 25 for connections to GMail server. -------------------------------- If you want to configure multiple mail receivers, use a comma (,) to separate the addresses. The parameters From, To, Cc, Bcc, Subject, Mail Body as well as the attachment name, can be dynamically set at runtime from message headers or content. 

Sender Mail Adapter - Basics

Image
Sender Email Adapter: Download e-mails from mailboxes using IMAP or POP3 protocol. Can access contents of mail body. Access email attachments. To access the mail attributes/Headers like (Subject, From, To) , we have to allow these headers in the Runtime Configuration... in order to whitelist them. To access the attachments, Script has to be used. No functionality to authenticate the sender of an e-mail. -------------------------------------------------------------- Sender email adapter: Parameters: Address: 143 for IMAP+STARTTLS   993 for IMAPS   110 for POP3+STARTTLS   995 for POP3S Proxy Type: Select None if you are connecting directly to the email server. Select On-Premise if you are connecting to on-premise system. Location ID (only if On-Premise is selected for Proxy Type)  : To connect to an SAP Cloud Connector instance associated with your account, enter the location ID that you defined for this instance in the destination configuration on ...

Value Mapping

Image
The value mapping referencing is required when a node value of a message needs to be converted to another representation.  For example, Weight in Company A is referred as as 'Kg' whereas in Company B it is referred  as ''Kilogram". When Company A sends message to Company B, it needs to take care of the difference in the representations of the same item. Populate Sender Agency, Schema and Value Value Mapping can also be imported from a .CSV file. Separator should be Pipe " | " Operator.

UDFs Groovy Script in Message Mapping

 The execution mode for functions are supported by two types :  ● Single value - Here, the Function Return type can only be String Template: ----------------------------------------------------------------------------------------------------------------- import com.sap.it.api.mapping.*  def String extParam(String P1,String P2,MappingContext context)  {   String value1 = context.getHeader(P1);   String value2 = context.getProperty(P2);   return value1+value2;  }  ----------------------------------------------------------------------------------------------------------------- ● All values of context - No return statement to be used here. Argument 'output' is to which we can add values All the String inputs should be of Type Array. Template: ----------------------------------------------------------------------------------------------------------------- import com.sap.it.api.mapping.*  def void extParam(String[] P1,String[] P...

Database Transactions

If one of the below listed steps is contained in an integration flow, the processing of the message is executed in one transaction. ●Data Store Operations step Select (in case delete=true) Write Get (in case delete=true) Delete ●Usage of Write variables ●Aggregator step ●Content Enricher In case of an error, the whole process is rolled back and the original state is being re-established. That means, data from failed processes remain and, in case message processing fails, customers normally cannot access data about the failed processing (due to the roll-back). In case an error is propagated back to the calling component, all data that have been written in the course of the (failed) transaction are being removed (in other words: not persisted in the database). For the calling component, an error implies, therefore, to restart the integration flow. Transactional processing is also to be considered in scenarios that contain asynchronous decoupling.  Let’s assume integration flow A cont...

Additional Exchange Properties in CPI

SAP_CorrelateMPLs You can use this property to specify whether message processing logs (MPLs) are to be correlated with each other using a correlation ID. By default, MPL correlation is switched on. To specify this property, select Constant as Type and enter True or False as Value. SAP_ReceiverOverwrite SAP_ErrorModelStepID You can use this property to set a Model Step ID for an integration flow step. This identifier is required to relate to an integration flow step in error handling. SAPJMSRetries Contains the number of retries of a JMS message. You can use this property to specify that the behavior of the integration flow changes depending on the number of retries that are actually performed. For example, you can configure a scenario where a mail is sent to an administrator with the message as an attachment and the integration flow is terminated successfully after a specified number of retries. SAPJMSAlerttime Specifies the time when an alert needs to be sent. SAPJMSRetryAt Specifies...

Additional Message Headers in CPI

We can use the following headers under Message Header : ●SAP_ApplicationID When you monitor the messages at runtime, you can search for all messages whose defined SAP_ApplicationID has a specific value (displayed as the MessageID attribute in the Message Monitoring editor). ●SAP_Sender ●SAP_Receiver ●SAP_MessageType You can use this property to categorize messages. ●SAP_MessageProcessingLogID Can use this property to read the ID of the message processing log (no write access supported). If you have specified SAP_Sender or SAP_Receiver, the corresponding values are displayed in the message processing log. If you change the SAP_Receiver value during message processing, all values are added to the receiver field in the message processing log as a comma-separated list. If you don't want this behavior, you can specify the exchange property SAP_ReceiverOverwrite, as below: --------------------------------------------------------------------------------------------------------------------...