0 votes
1.5k views
in Coach Views by

1 Answer

0 votes
by (16.3k points)

You will define a service in the coach view and create equivalent config options as per the default service inputs, in the load behaviour section code similar to this will work

The areas highlighted in bold will be specific to your implementation, the number of inputs should match the number of service inputs and param identifiers should be exact else service call will fail, in var input we are basically defining an array of inputs with labels and values

var _this = this;
var input = {RESTAPIUsername: this.context.options.RESTAPIUsername.get("value"), RESTAPIPassword: this.context.options.RESTAPIPassword.get("value"), EnvironmentHostname: this.context.options.EnvironmentHostname.get("value"), EnvironmentPort: this.context.options.EnvironmentPort.get("value")};
var serviceArgs = {
  params: JSON.stringify(input),
  load: function(data) {
console.log("service returned: ", data);  
    require(["dojo/_base/url"], function(url) {

//Do something you want wi the data heree by using data.someparam notation e.g. here we are setting the image data to a html string and updating the binding
    var imghtml = "<img alt='Embedded Image' src='data:image/png;base64," + data.imagedata + " ' />"  
    _this.context.binding.set("value", imghtml);

    });
  },
  error: function(e) {console.log("service call failed: ", e);}

this.context.options.UserImageRetrievalService(serviceArgs);

Related questions

0 votes
1 answer 731 views
0 votes
1 answer 990 views
0 votes
0 answers 469 views
0 votes
1 answer 558 views
0 votes
0 answers 593 views
0 votes
1 answer 367 views
+1 vote
1 answer 1.3k views
0 votes
1 answer 650 views
0 votes
1 answer 478 views
+1 vote
0 answers 488 views

635 questions

495 answers

98 comments

2.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...