BPM, Workflow, and Case

  • 1.  Calling services flow from coach views

    Posted Fri September 17, 2021 04:25 AM
    Hello community I hope you are doing well

    I'm looking for how I can Calling services from coach views with inline javascript

    I saw on the documentation (link) but I tried it doesn't work I have a 401 error

    That's all i did



    Thanks in advance





    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------


  • 2.  RE: Calling services flow from coach views

    Posted Fri September 17, 2021 08:25 AM
    Hi Mehdi,

    I think you have not configured your service to allow AJAX calls; you are getting unauthorized error.
    So, can you check the access level from the overview tab of the service, probably Do not allow Ajax calls is selected. If so, can you change that to Allow calls from all users to allow any user that is authenticated with BAW to call the service flow

    ------------------------------
    Atanu Roy
    Solution Architect
    Salient Process
    ------------------------------



  • 3.  RE: Calling services flow from coach views

    Posted Fri September 17, 2021 08:51 AM
    Hi Roy ,

    Thank you for your answer yes indeed I had not authorized ajax calls but after I reactivate that I do not receive an answer if you can help me again it would be perfect


    Thank you.

    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------



  • 4.  RE: Calling services flow from coach views

    Posted Fri September 17, 2021 08:57 AM
    Hi Mehdi,

    I think the code is incorrect, it is missing the required items in the parameter. It should be like format - 
    var input = {text: this.context.options.service_option_name.get("value")};
    var serviceArgs = {
      params: JSON.stringify(input),
      load: function(data) {
         console.log("service returned: ", data);  
      },
      error: function(e) {console.log("service call failed: ", e);}
    } 
    this.context.options.service_name(serviceArgs);​


    ------------------------------
    Atanu Roy
    Solution Architect
    Salient Process
    ------------------------------



  • 5.  RE: Calling services flow from coach views

    Posted Fri September 17, 2021 09:24 AM
    Hi Roy,

    Yes it works thank you very much i learned a new thing with your help

    ------------------------------
    El Mehdi ES-SAFI
    ------------------------------