Problem
CAP supports the old BTP portal out-of-the-box in a multitenant environment. In theory, Work Zone also supports multitenancy and should be compatible with CAP multitenancy. Unfortunately, it’s not yet built into the CAP commands. While it’s still possible to use the BTP Portal service, it’s not the most ideal solution. You may already have entitlements for Work Zone assigned, or perhaps you prefer not to rely on a deprecated service for your multitenant application. Whatever your reason, I’ve discovered a way to enable Work Zone in this scenario.
Solution
First step is to enable multitenancy in your CAP application, follow the steps here: https://cap.cloud.sap/docs/guides/multitenancy/#multitenancy
In the deploy step, the documentation explains how to add the Portal Service:
https://cap.cloud.sap/docs/guides/multitenancy/#deploy-to-cloud
Run this command to add the portal service:
This will add configuration to the mta.yaml and a subproject in the app folder.
First, change the configuration for the portal service in the mta resources to the Work Zone service:
In the mta modules, change the config so it is connected to the resource of Work Zone:
In the app folder, you’ll find a folder for the portal. I renamed this to workzone. Besides that, all the other configuration files are the same as for the portal:
You can configure the tiles for your multitenant application in the “CommonDataModel.json” file.
Second step, adding Work Zone to the sidecar as a SaaS dependency like described here: https://cap.cloud.sap/docs/guides/multitenancy/#saas-dependencies
This is a simple Boolean for the portal service but not for Work Zone.
Solutions to use Work Zone, is adding the following config:
With this, you should be able to use Work Zone in a multitenant CAP application.