0 votes
262 views
in Coach Views by

1 Answer

0 votes
by (10.6k 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
0 answers 42 views
0 votes
0 answers 60 views
0 votes
1 answer 21 views
0 votes
1 answer 55 views
+1 vote
0 answers 82 views
0 votes
1 answer 139 views

495 questions

405 answers

81 comments

1.6k users

Created By Dosvak LLC (WWW.DOSVAK.COM)
Our Public Git Repository

Dosvak UI Toolkit --- Download --- Demo

Subscribe us at

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.
...