B2B archiving for SAP Integration Suite (B2B Scenarios / Trading Partner Management) without a real content management system. A CMIS repository, the CMIS File Gateway, is implemented as an integration flow (iFlow) on Cloud Integration; the archived B2B payloads are forwarded to a plain file server via SMB or SFTP.
This README describes the idea and the design. All setup steps (service keys, iFlow import and configuration, destination, activation, agreements, verification) are in the Admin Setup Guide.
SAP Integration Suite can archive the payloads of B2B messages (EDI interchanges, ...), but it only supports a CMIS repository (e.g. SAP Document Management Service) as target. Many customers simply want the documents on a file server.
This repository closes that gap:
- The archiving job of Trading Partner Management (B2B Scenarios, agreement with archiving) uses the
destination
CloudIntegration_B2BArchive, which holds the connection data: the URL of iFlow 1 and the OAuth2 client. - With it, the job calls iFlow 1 with the CMIS Browser binding (HTTPS, OAuth2).
- iFlow 1 answers the CMIS dialog itself and keeps the repository metadata (folders, documents, types) in a Data Store.
- Only
createDocumentis handed over synchronously via ProcessDirect to iFlow 2. - iFlow 2 unpacks the document and writes it to the file server via SFTP or SMB.
- The archiving job believes it talks to a CMIS repository.
- iFlow 1 answers the CMIS requests (repository info, types, folders, documents, children, ...)
and keeps the "repository" state (folders, documents, custom types) in a Data Store, so the
job's dialog (create type, create dated folders
year/month/day, upload, read back) works like on a real DMS. - Only the payload upload (
createDocument) is passed on to iFlow 2, which unpacks the document and writes it to the file server.
Besides metadata nothing is stored in the CMIS File Gateway – the content ends up on the file
server only. Content download (cmisselector=content) is therefore not supported.
| Path | Description |
|---|---|
B2B_Archive_2_File_Step_1/ |
iFlow 1 – CMIS File Gateway endpoint (CMISResponse.groovy) |
B2B_Archive_2_File_Step_2/ |
iFlow 2 – extracts the document and writes it to the file server via SMB or SFTP |
docs/ADMIN_SETUP.md |
Setup guide for BTP / Integration Suite admins: all installation and configuration steps, parameter reference, troubleshooting |
LICENSE |
MIT License |
- Sender: HTTPS, path
/archive/2/smb, user role from the externalized parameterhttpsUR. Allowed incoming headers are restricted toobjectId|repositoryId|Content-Type|Content-Length|FileName(prevents CMIS bracket parameters likepropertyId[0]from becoming headers). - Script
CMISResponse.groovy: implements the CMIS 1.1 Browser binding (JSON):repositoryInfo,typeDefinition/createType(e.g.b2b:document_v2),createFolder,createDocument,object,children,parent(s),allowableActions,deleteObject. Behaviour (404/409 answers, allowable actions, paths) is aligned with SAP Document Management Service. - Data Store ("Write to DS", "Get objectId", "Read all entries"): persists folders, documents and custom types so later lookups and listings work.
- Routing (by exchange properties set in the script):
GETwithout query string (e.g. the first call of an archiving run) → the whole Data Store is cleared ("Delete DS"), then the script answers; only while the exchange propertyClearDataStore(externalized parameter, defaulttrue) istrue,createDocument→ handed over to iFlow 2,createFolder/createType→ Data Store only,- everything else → answered directly by the script.
- ProcessDirect receiver:
/archive/2/smb.
- Sender: ProcessDirect
/archive/2/smb(called synchronously by iFlow 1, so a file-transfer error is returned to the archiving job). - Script
extractData.groovy:- parses the CMIS
multipart/form-dataupload, - turns the
propertyId[n]/propertyValue[n]pairs into exchange properties (b2b:interchangeDirection,b2b:senderTradingPartnerName,b2b:senderMessageType,b2b:senderInterchangeControlNumberand thereceiver…equivalents), - unzips the content (the document; a
.jsonmetadata file is ignored), - derives the target:
- direction
IN: directory<senderTradingPartnerName>/OUT, file<senderMessageType>_<senderInterchangeControlNumber>.edi - direction
OUT: directory<receiverTradingPartnerName>/IN, file<receiverMessageType>_<receiverInterchangeControlNumber>.edi
- direction
- parses the CMIS
- Receiver: file server adapter (SMB or SFTP). Which adapter, host and credentials
are used depends on the end user's environment and is configured per installation
(see the Admin Setup Guide).
Path/file-name pattern: directory
<target folder>/${property.ArchiveDirectory}, file name${property.ArchiveFileName}, with overwrite enabled and directories auto-created. - Exception subprocess:
exceptionHandler.
Installation and configuration are described only in the
Admin Setup Guide: prerequisites, service keys, import and deployment of the
iFlows, BTP destination CloudIntegration_B2BArchive, activation of B2B archiving on the tenant,
archiving in the agreements, verification, troubleshooting and the reference of the externalized
iFlow parameters.
- Apache Chemistry CMIS Workbench against the runtime URL – use the Browser binding (not AtomPub). The CMIS TCK passes without errors.
- The archiving job's dialog was replayed against the CMIS File Gateway and a real SAP Document Management Service and the answers were compared.
- Only the Browser binding is implemented (AtomPub code is disabled at the end of the script).
- Content download is not supported (404); content exists only on the file server.
- Documents are not checked for duplicate names; a second
createTypeof an existing type is answered with 201 (real DMS: 409). - Repository state lives in a Data Store with 30 days retention – older entries expire. Every
GETwithout query string clears it (intended: each archiving run starts with an empty repository); set the externalized parameterClearDataStoreof iFlow 1 tofalseto keep it.
Released under the MIT License. Copyright (c) 2026 SRB Consulting Team GmbH.