Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Archana
Product and Topic Expert
Product and Topic Expert
We are now in final and concluding part of this blog series. While most of the use cases, I receive queries on, are covered in the previous part of the blogs but I wanted to cover yet another aspect of calling external service from custom UI that is configured as the user-task in workflow.

When you use external service in your custom UI, it will work when the application is opened in a browser in standalone mode; but as soon as you integrate the UI with user-task in workflow, it would stop working. The reason is that the custom UI when shown as task in My Inbox, get routed via an internal destination named html5apps and so all the external call must include this destination in their relative path to be able to make the right call.

This can be achieved in 3 simple steps.

In this example, I will show you how to call SAP Cloud Platform Identity Authentication service implementation of the System for Cross-domain Identity Management (SCIM) REST API for User search, in your HTML5 application that is used as user-task in workflow.

Prerequisite:
You must have all desired authorisations to access the IDP. For more information refer the official guide of SAP Platform Identity Authentication Service API

  1. In your SAP Cloud Platform tenant, create a destination of the system that exposes the service. Note: If you want to propagate the user from My Inbox to your REST service, select App2App SSO as the authentication type to use.

  2. In your HTML5 application that is used as the task UI in workflow, define an additional route in the neo-app.json file. This destination targets the path pointing to your service, in the routes array:
    {
    "path": "/SCI",
    "target": {
    "type": "destination",
    "name": "identity_service_scim",
    "entryPath": "/service/scim/Users"
    },
    "description": "SAP IDP Service"
    }

     

  3. In your custom task UI application, call your service with the following URL: /html5apps/<taskui_application_name>/<destination_name>/<relative_api_path>
    _callSCIMService: function() {
    $.ajax({
    url: "/html5apps/mywfapp/SCI/”,
    method: "GET",
    contentType: "application/scim+json",
    async: false,
    data: ""
    });
    }

    » where mywfapp is the SAPUI5 application project name

     

  4. Save and Deploy the HTML5 application to SAP Cloud Platform

  5. Now open the application and you will see that your external services are fetching or posting the data as required.


You can apply the same steps to call SAP Cloud Platform Business Rules REST APIs or SAP SuccessFactors OData APIs etc. in your workflow user-task directly. You can also refer to the blog series by muralidaran.shanmugham2  where he explains this beautifully using self-registration scenario.

With this I complete the final part of the blog series covering all the information dimensions that you might need to include custom HTML5 application as user-task in workflow and various other overhauling aspects that your custom application might need in order to work correctly when used as Task UI. Example used were deliberately chosen to be simple so that I can communicate the objective clearly.

Hope all your queries get answered with this blog series. If not then I will be happy to help you!

Previous Related Blogs
Understanding Custom UI Integration with SAP Cloud Platform Workflow
Part 1A: Build your Custom HTML5 application in SAP WebIDE for Workflow
Part 1B: Using your Custom HTML5 application as User Task in Workflow
Part 1C: Working with Task APIs in your Custom HTML5 application
Part 2: Start Workflow from your HTML5 application
17 Comments