This series of blog posts will explain how you can model your integration Flow (iFlow) to create and update data in your Custom Business Object (CBO). As a prerequisite you should read blog post https://blogs.sap.com/2017/05/12/usage-of-odata-service-of-custom-business-object/. The Custom Business Object YY1_HCI_ID_ID_ORIGIN from that blog post is used in the following integration flows. As a best practice, the data is loaded in chunks of 1000 entries with 10 parallel processes.
The series is split in 3 parts. This blog post is the first part and explains how to model the iFlow only for header items. The second blog post explains how to extent the base iFlow for header items to include subnode items. The third blog post explains how to model the creation and update of subnode items. All explanations contain create and update use cases only.
Step 1: Splitter to package mass data into chunks of 1000
To not overload the CBO backend system, the data is handled in chunks of 1000. A general splitter is used for that purpose, as this splitter type keeps the encapsulating element <Runs>. The incoming payload is split at XPath //Run:
Step 2: Map request chunks to OData Batch Processing
To setup the message mapping to the OData service call, you must add step 3 first. Step 3 will create the required target XSD. When you have the XSD, you can create a message mapping from your incoming split message to the OData service call. For the source message you need an XSD file that matches your incoming message. Add source and target XSD to your message and create the following mapping:
Disable the target tag <headers>. All entries are added to one changeset to allow a mass processing on SAP Marketing Cloud. Putting each entry to an own changeset would be processed like single record processing. The source tag <Runs> is mapped to the tag <batchParts>. The target tag <batchChangeSet> gets an empty constant assigned to create the tag. The tag <Run> is mapped to the tag <batchChangeSetPart>. The target tag <method> is mapped to a constant ‘POST’ as an upsert function is called with a POST method. The target tag <uri> is created out of several concatenations:
Step 3: Request Reply for OData Batch Processing Call
To call a receiver in a local integration process, you need a request reply step.
Setting up the connection to the receiver will create an XSD which you need in step 2. You need to setup the connection as follows:
Select OData V2 as channel type and choose the select button on the processing tab. Select remote as connection source and connect to your SAP Marketing Cloud system. Choose Function Import as Operation and Function <CBO Name>Sap_upsert. Select Batch Processing.
Finish the Model Operation. You are informed that a new XSD File has been created. Go to the processing tab and select JSON as Content Type and set 5 minutes as timeout as this is the normal allowed runtime in SAP Marketing Cloud system.