Service call
Invokes a service that can be triggered by an On load event handler or programmatically.

Appearance
Busy indicator: Busy icon to show while the service call is executing.
{None | Spinner | Refresh | Cog}
ServiceIndicatorType

Behavior
Called service: The service that runs when this view executes. Takes in the Input Value as an argument for the service, and outputs the result as the bound data of this view.
Input value: The value used as input to the service. If this value changes, the service is automatically invoked with the updated input. ANY
Auto run: Run on start and whenever input data changes Boolean

Formula
Input value formula: String

Events
On Load:
Description: Triggers whenever the view is loaded.
Example:
me.execute(${Data1}.getValue())
On Invoked:
Description: Fires when service is invoked.
Example:
${SvcButton}.setEnabled(false);
On Before Result:
Description: Fires when the service returns a result and prior to the result being processed to allow for data augmentation.
Example:
alert("Service call returned: " + data.results);
On Result:
Description: Fires when the service returns a result.
Example:
alert("Service call returned: " + result);
On Error:
Description: Triggers when an error is returned from the service. To return an error, an AjaxError object should be used as an output variable inside the service. This can be used in conjunction with an Error Intermediate Event to catch any errors (and set the AjaxError object accordingly).
Example:
alert("Service error: " + error.errorText);
Extends:
com.ibm.bpm.coach.CoachView
Methods:

execute(input)
Executes the attached AJAX service
NameTypeDefaultDescription
input{ANY}Input data for the AJAX service (type will depend on the binding type of the AJAX service)

Inherited getData() Returns: {Object}
Retrieve bound data associated this view/control. Only works for views/controls with bound data.
Example
var dec1 = MyDecimal.getData();

getInputData() Returns: {ANY}
Returns the input for this service

getLastError() Returns: {ServiceError}
Get most recent error thrown

getResult() Returns: {ANY}
Returns the result from the attached AJAX service

isAutoRun() Returns: {boolean}
Returns the indicator for Auto Run

Inherited isBound() Returns: {boolean}
Indicates bound status of control.

Inherited isLabelVisible() Returns: {boolean}
Checks if control label is visible
Example
var labelVisible = MyView.isLabelVisible();

Inherited isValid() Returns: {boolean}
Returns the valid status as last set by the setValid() method.
Example
var valid = MyView.isValid();

Inherited propagateUpValueChange(event) Returns: {boolean}
Propagates value change of control up through parent views
NameTypeDefaultDescription
event{Event}Value change event (usually an onchange event)
Example
MyView.propagateUp(event);

setAutoRun(flag)
Specifies whether this service runs automatically on load and whenever the input value is updated
NameTypeDefaultDescription
flag{boolean}Set to true to enable autorun for the service

setInputData(data)
Specifies the default input for this service
NameTypeDefaultDescription
data{*}the input data

Inherited setLabelVisible(visible)
Show/hide the label of this view/control
NameTypeDefaultDescription
visible{boolean}Label visibility flag (true to show view label, false to hide)
Example
MyView.setLabelVisible(false);

Inherited setViewData(data, createPseudoBinding)
Set/update bound data associated this view/control. Only works for views/controls with bound data.

Note: Should only be used with simple type bindings, or complex type bindings with simple type properties.
Should not be used with bindings that have properties that are lists or compext types. For complex types, set bindings using
the binding.set pattern detailed in the Knowlege Center section Binding Data and Configuration Options
NameTypeDefaultDescription
data{Object}Value of bound data. The type of this parameter must match the type of the bound data.
createPseudoBinding{boolean}If set to true, creates a pseudo binding if there is no current binding.
Example
MyView.setViewData("TEST"); //Updates bound data to the string 'TEST'

Inherited triggerFormulaUpdates([phase])
Broadcasts the expression trigger for the specified view
NameTypeDefaultDescription
phase{int}bpmext.ui.PHASE_NORMALThe phase we are currently in
Example
MyView.triggerFormulaUpdates();