Log in to the SAP CPI console and click on this pencil icon to enter the work area:

Select an existing content package:

Create a new iFlow in this content package:



The default generated iFlow model is as follows. Delete Sender, because in the simplest iFlow, we use timer:

Delete Sender as shown below:

Select a Timer as an iFlow trigger:

Drag tinmer into the Integration Process area, select the Scheduler property, and set it to Run Once.

Drag another Content Modifier into the Integration Process area, switch to Message Body, and maintain a Hello World:

Connect start Timer with Content Modifier:

Add a Groovy script:

Click on the Create TAB of the script step:

Create a new text file locally and paste the following groovy code into it and save it as test.groovy:

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message)
{
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog ! =null)
{
messageLog.addAttachmentAsString("Log current Payload:", body, "text/plain");
}
return message;
}
Copy the code

Upload the local Groovy file to the script step:

Connect the Content Modifier to the Groovy Script and deploy it recently.

After the deployment is successful, go to the Operation view to check the iFlow execution status. Click tile “All Integration Flows” :

Status: The execution succeeded

Before the attachment area can be seen in groovy script attachments stored: messageLog. AddAttachmentAsString (” Log current content: “, the body, “text/plain”);

This is where the simplest iFlow demonstration succeeds:

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: