This public repository is read-only and no longer maintained.
Workflow and ERP integration for the SMB Eats prototype
This repository is comprised of the workflow definitions and integration flows required by the smb-eats-backend sample. It orchestrates the following steps:
- Pizza shop manager needs to approve a customer's order request;
- Sales Order is posted to the SAP Cloud ERP;
- Kitchen needs to release the pizza for delivery as soon as it's ready for pickup;
- Post Goods Issue to the SAP Cloud ERP;
- Rider needs to acknowledge pizza's pickup for delivery;
- Rider needs to confirm customer has received the pizza.
- Sends a Qualtrics satisfaction survey to the customer's e-mail;
- Post Customer's Invoice to the SAP Cloud ERP.
- A free trial account on SAP Business Technology Platform with Cloud Foundry Trial initialized;
- Follow this tutorial to get a trial SAP Business Technology trial account;
- Setup your SAP Business Technology Platform Integration Tenant by following this tutorial. The documentation Initial Setup of in Cloud Foundry Environment can also help you to understand the whole setup process;
- Set up Workflow Management as per this tutorial;
- Configure your development space at SAP Business Application Studio so you can import the provided workflow project. Folow step 1 of this tutorial to set up your environment correctly;
- A SAP Business ByDesign or SAP Business One or SAP S/4 HANA Cloud test tenant;
- A Qualtrics Survey demo tenant.
- Configure the destination for the CPI tenant by importing the file "destination_CPI_SA" to the Connectivity > Destinations of your subaccount (required to create the documents in the SAP Cloud ERP).
- Do the same with the file "destination_bpmworkflowruntime_mail" to configure the SMTP server destination (required to send the email survey).
- Check here how to import a destination from a file.
Clone this repository using the Business Application Studio;
Then go ahead, build and deploy the workflow itself;
If you want to test your workflow, browse to the SAP Business Technology Platform Trial Account, select your trial subaccount, select your dev space and open your Workflow Management Application. Select the Monitor Workflows > Workflow Definitions, hit "Start New Instance" and replace the "recipient" and "CustomerEmail" with the e-mail you use to login to your trial account. Click "Start New Instance and Close" and head to the "Inbox" tile. You should have a task awaiting for approval.
The communication between Workflow and your ERP Backend is done via Integration Flows implemented in your Integration Tenant (CPI).
The workflow is ERP agnostic and calling CPI flows in order to get the documents created at the ERP. Workflow just needs to change a context variable in order to select the required ERP.
For our prototype we have considered 3 ERP backends: SAP Business One, SAP Business ByDesign and SAP S/4 HANA Cloud. The steps to follow are the same, just some of them will be dependent of course of the ERP backend chosen:
SAP S/4 HANA Cloud is providing OData and SOAP APIs. In order to enable the APIs, a communication user, communication system and the communication arrangement need to be created. Please check the following API's documentation giving details about the required Communication scenarios:
- Create Sales Order
- Create Outbound Delivery
- Billing Document - Create with SD Document Reference
Check this blog if you need explanations on Setting up Communication Management in SAP S/4HANA Cloud
In order to get the required OData APIs ready to be consumed please follow the blog SAP Business ByDesign – OData API Examples providing a full set of custom OData APIs ready to be downloaded and imported into ByDesign, we have used some the provided APIs in our prototype.
In the case of SAP Business One we are consuming the OData v4 APIs provided by SAP Business One Service Layer. There is no preconfiguration required in order to access the APIs, just make sure the corresponding ports are open.
Download the provided Integration Package:
- For SAP S/4 HANA Cloud: S4Eats.zip file from the cpi-flows github folder
- For SAP Business ByDesign and SAP Business One: SMBEats.zip file from the cpi-flows github folder
Follow this documentation if you need help on how to import a CPI package;
In both cases (SMBEats and S4Eats) you should get a package containing 3 flows:
You need to store your ERP backend technical user credentials into CPI. Please check this document for more details.
You can also find a sample with instructions at section "iii. Store B1 and/or ByD User Credentials at SAP Business Technology Platform Integration tenant" from the SMB Samples Step by Step guide to get details on how to store ByDesign user credentials in CPI.
Note: In the provided flows the user is named BYD_ADMIN or S4_SA, if you use a different name you will need to replace it.
The different parameters to be configured to connect to your specific ERP Backend have been defined in the flows using the Externalization feature.
Press the Configure link on the top right of each one of the provided flows:
A new screen opens where you can configure each one of the Receivers with the corresponding values required for the Connection.
In the case of S4Eats for SAP S/4 HANA Cloud:
In the case of SMBEats for SAP Business ByDesign:
In the case of SMBEats for SAP Business One:
Deploy one by one the 3 Integration Flows part of the package (same 3 flows are part of the ByD and S4 packages):
If you want to learn a more about the Integration Suite don't hesitate to check this blog that provides samples, a step by step guide and references to available materials.
This repository is provided "as-is". No warranty or support is available. Feel free to open issues.
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.