Skip to Content

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 Murali Shanmugham  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

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Shilpa Gopal

    Hi Archana,

    The AJAX call with URL with prefix “html5apps” doesn’t work on Cloud Fiori LP tile and standalone. How do I define the URL If I have to call same application from Cloud Fiori LP tile and via Inbox? Do I need to maintain 2 URLs based on where the application is accessed from? Like:

    If(Inbox)
    
    $.ajax({
    
            url: "/html5apps/mywfapp/SCI/”,
    
            method: "GET",
    
            contentType: "application/scim+json",
    
            async: false,
    
            data: ""
    
        });
    
    Else
    
    $.ajax({
    
            url: /SCI”,
    
            method: "GET",
    
            contentType: "application/scim+json",
    
            async: false,
    
            data: ""
    
        });

     

    Thanks,

    Shilpa

    (0) 
    1. Archana Shukla Post author

      Hello Shilpa,

      Yes, you are right the relative URL wont work if you are not trying to open it via MyInbox. The same application wont work if you want to add a tile and open that application.

      For that, you have to use the normal destination based relative URL like “/bpmworkflowruntime/workflow-service/rest/v1/xsrf-token”, in your application code. And then add the application as tile in FLP. You cannot use the same application for MyInbox and for custom application. You can read other blogs in the series that talk explicitly about custom application

      (0) 
  2. Former Member

    Hi Archana,

    When I was updating my Usertask UI, it can’t be updated correctly in My Inbox even though I deployed again the project and republish my site in portal service. I have updated the codes of my Usertask UI in web ide actually, I don’t know what should I do to update the UI in My Inbox correctly.

    When you feel free, could you please tell me the solution?

    Best regards,

    Joy Lee

    (0) 

Leave a Reply