cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger SCP Workflow in SAP HANA xsjs

Tri
Participant
0 Kudos

Hi everyone,

I've been running workflow api in UI5 applications but now I've got requirements to run it in xsjs.

The problem is how to set up the xshttpdest.

1) The destination created on SCP is using AppToAppSSO. So how can I convert to to other authenticate types in xshttpdest.

2) What is the workflow port number since in xshttpdest port number is mandatory?

Regards,

Tri

Archana
Product and Topic Expert
Product and Topic Expert
Hello Minh,
  • Yes what Tobias has send is correct.

    You can also use Basic Authentication instead of AppToAppSSO and for that you need to create a new destination in SCP Cockpit.

    You can then create xttpDest like as follows:

    description = "WorkflowDestination";
    host = "bpmworkflowruntime.hana.ondemand.com"; <this host will host for your SCP>
    port = 443;
    pathPrefix = "<workflow service API relative URL>";
    proxyType = none;
    authType = basic;
    useSSL = true;
    timeout = 500;
    sslAuth = client;

    and then you can call API in standard way in xsjs

    var destination =$.net.http.readDestination("com.sap.demo", "WorkflowDestination");
    var client = new $.net.http.Client();
    var xrftoken = retrieveXSRFToken(destination, client);
    var service = '<workflow service API URL>
    var request = new $.web.WebRequest($.net.http.POST,service);
    request.headers.set('x-csrf-token',xrftoken);
    request.headers.set('Content-Type','application/json');
    .... etc.

    Hope that helps,
    Archana

Accepted Solutions (1)

Accepted Solutions (1)

tobias_breyer
Contributor
0 Kudos

Hi Tri,

1) AppToAppSSO is a UI authentication concept on Cloud Platform Neo that enables SSO between different applications. It has no direct relation to XS destinations (AFAIK), because they concern non-interactive communication (backend communication).

You can however use all xshttpdest authentication types that match with those supported by CP Workflow. See

https://help.sap.com/viewer/f85276c5069a429fa37d1cd352785c25/Cloud/en-US/df943e71122448caaf3c49f5ffd...

2) Cloud Platform Workflow always runs on HTTPS protocol which defaults, according to Internet standards, to port 443.

Regards,

Tobias

Tri
Participant
0 Kudos

Hi Tobias,

Thank you for your reply.

I'll try with the link you give me.

Regards,

Tri

Answers (0)