BPM, Workflow, and Case

 View Only
  • 1.  Error calling BPM REST services

    Posted Sat August 08, 2020 10:32 AM
    Edited by Laszlo Kertesz Sat August 08, 2020 01:37 PM
    Hi All,

    I'm trying to call the REST services of the BPM (BAW), following the instructions of the page https://www.ibm.com/support/knowledgecenter/en/SS8JB4/com.ibm.wbpm.wle.editor.doc/topics/cdev_restapis_invoke_rest.html, but unfortunately unsuccessful :(.

    I have a REST server with all the necessary settings:

    an External service:

    and a Service Flow with the javascript code to call the service:

    var request = new BPMRESTRequest();
    request.externalServiceName = "BAWRESTService";
    request.operationName = "processes";
    request.httpMethod = "GET";
    request.httpHeaders = {"Content-Type" : "application/json", "Accept" : "text/plain"};
    tw.local.response = tw.system.invokeREST(request);

    The operation name "processes" is written in the swagger file:


    But I get the error "Cannot find the selected OpenAPI operation name "processes" in the external service.":

    I don't understand this... How could I call the operations of the BPM REST?

    Unfortunaely I can't use an External Service which it is created as External Implemetation. In this case I get the error Cannot create the REST binding invoker. Binding is: null.

    On the other hand I can call BPM REST services from SoapUI, but the process list retrieval operation name is processApps instead of processes (using the URL host/rest/bpm/wle/v1/processApps). It is confusing...

    Any help appreciated!

    Thx,

    ------------------------------
    ____________________
    Laszlo
    ------------------------------


  • 2.  RE: Error calling BPM REST services

    Posted Mon August 10, 2020 04:27 PM
    Can you please share the Swagger file?

    ------------------------------
    Deepak Champatiray
    ------------------------------



  • 3.  RE: Error calling BPM REST services

    Posted Tue August 11, 2020 04:08 AM
    Hi Deepak,
    Niw I'm on holiday without a computer, but you can chexk the swagger file from this url (if I remember well...): server/bpm/docs.

    Meanwhile I've read that this do not give the full rest functionality of the bpm.

    Therefore I tried to use it without swagger file, but that gave and error as I wrote before.


    ------------------------------
    ____________________
    Laszlo
    ------------------------------



  • 4.  RE: Error calling BPM REST services

    Posted Tue August 25, 2020 09:39 AM
    why dont you try hitting the internal REST URLs directly from BPM?

    ------------------------------
    Vivek
    ------------------------------



  • 5.  RE: Error calling BPM REST services

    Posted Thu October 15, 2020 10:32 AM
    Can you share the swagger file so that we can understand it better? Or else find a helping hand to learn IBP BPM

    ------------------------------
    mohammad irshad
    ------------------------------



  • 6.  RE: Error calling BPM REST services

    Posted Thu October 15, 2020 03:36 PM
    This is probably mistake in your swagger file  - operationId is missing.

    e.g.  for such definition of deleteProcess (fragment from swagger)
    "paths": { "/process/{processId}": { "delete": { "summary": "delete process", "description": "delete process instance", "operationId": "deleteProcess", "produces": [ "application/json" ], "parameters": [ { "name": "processId", "in": "path", "description": "process id to delete", "required": true, "type": "integer" }​

    Your code should look like:

    request.externalServiceName = "BAWRESTService"; request.operationName = "deleteProcess";

    So if you are using operation name "processes"  - you have to define also  operationId "processes".
    Path is not the same as operation name.




    ------------------------------
    Sebastian Tylko
    ------------------------------



  • 7.  RE: Error calling BPM REST services

    Posted Thu October 15, 2020 07:39 PM

    … and if you use out-of-the-box BAW swagger file  ( from /bpm/docs)  this operationId is called getProcess

     Fragment of out-of-the box file:

    "/processes/{process_id}": {

                                  "get": {

                                                 "summary": "Retrieve a process instance.",

                                                 "description": "Retrieves detailed   ... ",

                                                 "operationId": "getProcess",

    ...
    so
    request.operationName = "getProcess";



    ------------------------------
    Sebastian Tylko
    ------------------------------