0 votes
475 views
in Coach Views by

1 Answer

0 votes
by (16k 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 103 views
0 votes
0 answers 91 views
0 votes
1 answer 33 views
0 votes
0 answers 103 views
0 votes
1 answer 57 views
0 votes
1 answer 76 views
+1 vote
0 answers 163 views

580 questions

482 answers

85 comments

1.7k users

Dosvak IBM BPM /BAW Products, Download Evaluation
Process & Performance Tools Process & Performance Tools
Code Analyzer Code Analyzer
UI Toolkit UI Toolkit
Integration Monitoring Integration Monitoring
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
...