In this how to guide, you will clone an existing CAP application to your SAP Business Application Studio dev space, deploy and test your application.
-
Go to https://github.com/SAP-samples/successfactors-extension-calculate-employee-seniority and fork the repository so that you have the source code and can further on work and change the code. (For instance, in one of the subsequent steps you can customize the business rules to your own requirements)
the screenshot was created when the repository was still private. that's why the fork button appears to be disabled.
Important: When forking, uncheck the checkbox that says 'copy the main branch only' (see below), to make sure you also have the content of the SAP Build Branches (these e.g. contain the complete code for the end-to-end scenario)
-
Choose your user as destination for the fork.
You should now have the following repository: https://github.com/**YourUser**/successfactors-extension-calculate-employee-seniority
-
Choose Terminal -> New Terminal in the menu on the top of your screen.
-
In the opened terminal go to projects folder with executing
cd projects
-
Clone your forked sample GitHub repository for this mission.
git clone https://github.com/SAP-samples/YourUser/successfactors-extension-calculate-employee-seniority
IMPORTANT: Replace YourUser with your actual username.
-
Click on File in the menu on the top and choose Open Workspace in the drop down.
-
Open the project by selecting projects -> successfactors-extension-calculate-employee-seniority and click on Open
-
Namespace of the Messaging client can be changed in em.json.
em.json:
{
"emname": "seniority_calculator",
"namespace": "sap/successfactors/<NAME-OF-MESSAGING-CLIENT>",
"options": {
"management": true,
...
- Modify the topic name in srv/emp-service.js to include the name of the Mock system.
messaging.on(
"sap/successfactors/<NAME-OF-MESSAGING-CLIENT>/isc/contractchange",
...
)
NOTE: Changing the namespace is optional (steps 8 and 9). But if you wish to do so, please remember to update the messaging client in the mock service as well (as shown in the section Deploy mock mtar file Step 8)
- Change the redirect URL in xs-security.json, based on your BAS URL.
{
"xsappname": "seniority-calc",
"tenant-mode": "dedicated",
"scopes": [],
"attributes": [],
"role-templates": [],
"oauth2-configuration": {
"redirect-uris": [
"https://*.<region>.applicationstudio.cloud.sap/"
]
}
}