How to package and release Java based SuccessFactors extension apps for subscription on SAP Cloud Platform Productive account – Part 4
In the previous blog you learned how to package and release extension application in a standalone or standard mode. When the solution is deployed in a standard mode, it can only be used in the current SAP Cloud Platform subaccount and subscription to it is not possible. All entities that are part of the solution will be deployed and managed within the extension subaccount where solution was deployed.
In this blog we will focus on how to deploy solution in a provided mode for subscription to another SAP Cloud Platform sub account which is referred as consumption model or deploying of multi-tenant application. I’m going use terms provider account “sub account where solution is deployed in a provided mode and also this sub account is not paired with any SuccessFactors instance” and consumer account “extension sub account from where subscriptions are made and usually this account is paired with SuccessFactors instance” through out this blog.
As depicted in the above architecture diagram, The solution is deployed to the provider sub account, but provided for subscription to another SAP Cloud Platform sub account. Before the deployment of your solution, you have to set it as a provided solution. After that you have to grant entitlements to a given SAP Cloud Platform global account that will allow its sub accounts to subscribe to the solutions.
When providing a solution for subscription, you can define which parts of it will be deployed to your provider extension sub account, and which parts will be deployed to the subscriber’s sub account. Note:- The parts deployed to your sub account will consume resources from your quotas. All parts deployed to the sub account of the subscriber will consume resources from its own quotas.
Production Deployment Steps:
Steps for deploying extension solution using MTA archive file.
To demonstrate packing and deployment process, we will work with previously used sample benefits application to generate MTA archive file and deploy using Solutions. To make things easier, sample benefits application comes with pre-package content to facilitate learning of packing and deployment process. The steps described in this blog and the previous blog are more or less the same with slight differences.
Step1: Open Eclipse IDE and navigate to the Java Resources -> resources -> folder of benefits sample extension application.
In order to create MTA archive file, at minimum MTA archive should consists of the following:
The MANIFEST.MF file – Contain a name section for each MTA module part of the archive file.
The mtad.yaml MTA deployment descriptor file – This section contains the parameters and options that can be used to compose the structure of an MTA deployment descriptor.
Plus any other dependencies or resource types as defined in the mtad.yaml file.
Note:- Both MTA deployment descriptor and MTA extension descriptor uses the YAML file format, strictly adhere to the following syntax practices:
- The parameter names are case-sensitive
- The indents and spacing are specific
Step2: Open tiles.json file to make sure that you have right tiles.json file depending on the home page tile set in SuccessFactors Instance your working with. Since all these dependency files like tiles.json and roles.json gets package into resources folder of MTA archive file during build process. Mismatch of wrong tiles.json file could lead to deployment failure.
Please refer on line documentation for sample tiles.json file.
During Maven build process, MTA archive file is auto generated. Take a look at pom.xml for the configuration steps to generate auto MTA archive file.
Note:- Rename rolesXXX.json to roles.json and tilesXXX.json to tiles.json before doing maven build.
Step3: Also if your using “NEW_HOME_PAGE” tile make sure to change corresponding parameter in mtad.yaml file.
In the example above, you can see the following:
- The sample “Benefits” Java application module requires both database binding resource and the SAP SuccessFactors Roles module.
- The SAP SuccessFactors tile is defined as a parameter of the sample “Benefits” Java application and points to a JSON file within the Multi-Target Application archive
- SAP SuccessFactors is role provider which is defined as a parameter for the sample “Benefits” Java application
- The sample “Benefits” Java application is going to use the SAP SuccessFactors IDP for authentication
- The sample “Benefits” Java application is going to use the default connectivity options when accessing the SAP SuccessFactors system
Step4: Edit the Java Resources -> resources -> extension_descriptor.mtaext file
Set the following values for the parameters at the end of the file since benefits extension app has dependency on database to persist data.
Database details for the target account where solution is going to be deployed
id: <HANADBID> See the screen shot on how to get DB ID.
user-id: <userid> HANA database user id if applicable
password: <PWD> HANA database password if applicable
account: <Primary SAP Cloud Platform account in which database is provisioned> – Mostly in case of shared database.
Save the changes and do the maven build. Please refer previous blog on how to do Maven build.
The following example shows the basic structure of an MTA archive. It contains a Java application .war file and a META-INF directory, which contains an MTA deployment descriptor with a module and a MANIFEST.MF file and resources directory with tiles.json and roles.json which are dependency defined within mtad.yaml.
Example:- /benefits.war /META-INF /META-INF/mtad.yaml /META-INF/MANIFEST.MF /resources/tiles000.json /resources/roles000.json Note:-The Multi-Target Application (MTA) archive is created in a way compatible with the JAR file specification. This allows us to use common tools for creating, modifying, and signing such types of archives. Refer this link to learn more about Modeling SAP SuccessFactors Extensions.
Step5: Logon onto Provider sub account where the solution needs to be deployed.
Select the Solutions tab on the left-hand side and click on Deploy option.
Step6: Browse for the following files under your Eclipse project:
MTA Archive: target -> com.sap.hana.cloud.samples.benefits.mtar
MTA Extension Descriptor:Java Resources -> resources -> extension_descriptor.mtaext
Check Provider Import check box, since we are deploying solution in provider mode.
Finally click on Deploy option to start the deployment process.
Step7: Wait for the deployment process to complete and finally click on Finish button.
Step8: You will notice the solution is deployed Successfully with description as “Solutions Provided for Subscription” . Which means solution is available for subscription. Click on the solution title.
Step9: You will notice that only few artifacts got created in the provider account.
Step10: Next step is to Create solution entitlement. Which means your enabling solution for subscription to the consumer account. Select the Entitlements tab on the left-hand side.
You need to repeat this step for every consumer account subscription.
Step11: Select Create Entitlement and set the following values in the dialog box:
Global Account GUID: <Consumer Global Account GUID>
Effective Date <Date from which the entitlement will be effective>
Granted Entitlements: <Number of subscriptions available in the consumer account>
Click on Save.
Note : GUID can be found on SAP Cloud Platform Global account URL. As highlighted below
Step12: Next step is to verify subscription on consumer extension subaccount for which entitlement was created in the previous step. Logon to the Customer extension subaccount or consumer SAP Cloud Platform account.
Select the Solutions tab on the left and then find your solution under the Solutions Available for Subscription Section. Click on Solution title.
Step13: Click on Subscribe button
Step14: Select Subscribe option on the dialog box.
Note:-MTA extension descriptor file is optional during Subscribe process. Such an option provides flexibility to have parameters different for each subscription.
Alternatively, as of _schema version 3.1, if you do not provide extension descriptor file and your solution has missing data required for productive use, you can enter that data manually in the dialog subsection that appears. Keep in mind that you have to input complex parameters such as lists and maps in JSON format, makes it very difficult to manually enter and are error prone.
Step15: Wait for the subscription process to complete and finally click on Finish button to complete the subscription option.
Step16: Consumer extension sub account is subscribed to the extension solution deployed in the Provider subaccount. You will notice that all the artifacts relevant for consumer account gets created during the subscription process.
Step17: If you navigate back to the Provider sub account under the Entitlements section for your solution you can see the newly subscribed account listed there.
Step18: Log back to Consumer SAP Cloud Platform cockpit -> Navigate to Subscriptions tab ->Choose your Java Application Check out Destinations and Roles section.
All the artifacts gets created based on Solution components after subscription is done.
Step19: Configure extension application’s home page tile. By default, the new extension application tile is not visible until a consumer’s SAP SuccessFactors HR Administrator explicitly assigns to end users. Reason being, SuccessFactors HR Administrator knows best whom to assign based on the roles. To configure the group assignment and make the tile available go to Manage Home Page tool in SAP SuccessFactors
Login to SAP SuccessFactors instance where solution was deployed.Start typing Manage Home Page in the search field and select the entry once it is found.
Step20: Switch to the Not Used tab and select the pen button to edit the SAP Corporate Benefits sample app home page tile.
Step21: Switch to the Assignments tab and select the + button to create a new Group
Step22: Populate the Group Definition dialog window with values
• Group Name: BenefitsXXX Tile Group
• People Pool category: User
• User: <userid>
Click on Done buttons.
Step23: Select the newly created Group and click on finish button
Step24: Select Default from the Move To dropdown for your tile. The tile will disappear – it will be immediately moved to the Default group. Finally Save the changes.
Step25: Once the above configuration steps are done, you can see the extension application’s tile appearing on the SAP SuccessFactors home page. Open the application by selecting the tile.
Step26: You should see three tiles as shown below. Click on About me Tile to look at the current user information fetched from the SAP SuccessFactors OData User API.
Step26: You should see output as shown below.
Step27: Go ahead and assign custom role imported into SuccessFactors instance to your user id. After that you should see 2 additional tabs displayed after role assignment as shown below.
Refer previous blog for detailed steps. ( Part 5 : Step 1 to Step 4)
In this blog, your learned how an solution can be deployed to the subaccount, but provided for subscription to another SAP Cloud Platform subaccount and eventually how to grant entitlements to a given SAP Cloud Platform global account that will allow its subaccounts to subscribe to the solutions. When providing a solution for subscription, the provider defines which parts of it are deployed to your subaccount, and which parts are deployed to the provider subaccount.
The subscription model can be used to subscribe to ready to use partner apps that meets your requirement on SAP App. center or can be applied to custom development extension apps by modelling provider and consumer under the same SAP Cloud Platform global accounts or different global accounts.
This completes blog series which focused on deployment of java based SuccessFactors extension application to SAP Cloud Platform trial account , SAP Cloud Platform extension account and then how to release extension application in standard model and provider mode for consumption using SAP Cloud Platform provided Life cycle management tool. Hopefully it gave an complete picture on how SAP Cloud Platform offers various Life cycle management tools to manage lifecycle of an SuccessFactors extension application.
To learn more about Lifecycle Management of SAP Cloud Platform Applications check out learning journey.
Happy Learning !!