This public repository is read-only and no longer maintained.
This is a sample application to demonstrate how partners can created solutions that leverage several the SAP Business Technology Platform to create integrations and extensions to business applications (in this case SAP Business ByDesign).
It implements an end-to-end process of Food Ordering solution, from customer ordering to the delivery confirmation. Such process is handled by the Workflow Management Service.
The process starts with the "customer persona" that places an order using a Chatbot created with SAP Conversational AI.
"Restaurant employees" (i.e. Agent, Kitchen, Rider) interact with the workflow tasks via a custom application (this repository) that consume the Workflow APIs.
In between assigning tasks, the Workflow is also making request to the Integration Suite. This will handle requests to SAP Business ByDesign in order to create sales orders, outbound deliveries and customer invoices accordingly.
Once the delivery is confirmed and the process is finished, the customer receives a Qualtrics Survey to evaluate the experience.
- Free Trial Account
- Install the Cloud Foundry CLI
- smb-eats-integration deployed
- The Service Key Details of your workflow instance
Clone this repository
git clone https://github.com/SAP-Samples/smb-eats-backend.git
From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry
cf push --random-route
Allow your worfklow instance, created during the deployment of the smb-eats-integration, to expose APIs on needed scopes running the following command:
cf update-service <WF INSTANCE NAME> -c '{"authorities": ["WORKFLOW_DEFINITION_GET", "WORKFLOW_INSTANCE_START", "WORKFLOW_INSTANCE_GET", "TASK_GET", "TASK_GET_CONTEXT", "TASK_COMPLETE", "TASK_UPDATE"]}'
This will allow the backend application to consume Workflow APIs
Then set the Environment Variables accordingly
cf set-env smb-eats ACTIVITY_KITCHEN <Workflow Task ID for Kitchen>
cf set-env smb-eats ACTIVITY_DELIVERY <Workflow Task ID for Delivery>
cf set-env smb-eats AUTH_URL <User authentical URL as shown on the Workflow instance secret key>
cf set-env smb-eats AUTH_CLIENT_ID '<Client ID as on on the Workflow instance secret key>'
cf set-env smb-eats AUTH_CLIENT_SECRET '<Client Secret>'
cf set-env smb-eats WF_REST_URL <Workflow REST API URL>
cf set-env smb-eats WF_DEFINITION <Workflow Definition ID>
cf set-env smb-eats GMAPS_API_KEY <Google Maps Places API Key> //Optional
Example
cf set-env smb-eats ACTIVITY_KITCHEN usertask4
cf set-env smb-eats ACTIVITY_DELIVERY usertask5
cf set-env smb-eats AUTH_URL https://12312dstrial.authentication.eu10.hana.ondemand.com
cf set-env smb-eats AUTH_CLIENT_ID 'sb-clone-safasf-f519-asfsa-b3f2-asfsafc!b58935|workflow!b10150'
cf set-env smb-eats AUTH_CLIENT_SECRET '1231231-da64-123123-12412-1231231$s8uRBo-121123123-6-Go='
cf set-env smb-eats WF_REST_URL https://api.workflow-sap.cfapps.eu10.hana.ondemand.com/workflow-service/rest
cf set-env smb-eats WF_DEFINITION smbeats
Restart your application (so it can read the new environment variables)
cf restart smb-eats
For the chatbot deployment check chatbot-readme
This repository is provided "as-is". No support is available. Feel free to open issues or provide pull requests.
Copyright (c) 2021 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.