English
callTool
About 213 wordsLess than 1 minute
2026-09-04
This method is used to call the Operation Center. Pass the tool path through commandPath, business parameters through data, and optional settings through options. The method returns a Promise.
Syntax: FxUI.biz.callTool(commandPath, data, options)
Parameters
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| commandPath | Action path (required) | Array | — | — |
| data | Business data passed to the tool (required) | Object | — | — |
| options | Additional options | Object | — | { raw: true } |
options
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| raw | Whether to use raw return mode | boolean | true, false | true |
Example
import FxUI from 'fxui-mobile';
const commandPath = ['approval', 'runtime', 'my-approval-tasks'];
const data = {};
FxUI.biz.callTool(commandPath, data, { raw: true }).then((res) => {
if (res.success) {
console.log(res.data);
} else {
console.log(res.error);
}
});You can omit the third parameter. In that case, the default options are used:
import FxUI from 'fxui-mobile';
const commandPath = ['approval', 'runtime', 'my-approval-tasks'];
const data = {};
FxUI.biz.callTool(commandPath, data).then((res) => {
console.log(res);
});Return Value
Returns a Promise with the following structure on success:
{
success: true,
data: {}
}On failure:
{
success: false,
error: {}
}Notes
- The specific value of
commandPathdepends on the target tool capability. - The structure of
datadepends on the target tool capability. rawdefaults totrue. Otheroptionsfields should follow the documentation of the specific tool capability.
