English
Fx.function
About 690 wordsAbout 2 min
2026-01-09
Summary
The overview of this document is as follows: This document introduces the API definitions of Fx.function, usage methods, and related notes.
1. executeAsyncFunc Asynchronously Execute a Controller Function
Fx.function.executeAsyncFunc(<String functionApiName>, <Map param>)
Parameter Description
Input Format
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| functionApiName | String | API name of the function to execute | Yes |
| param | Map | Parameters passed when executing the function | Yes |
Groovy Example
Map keyValue = [
"key1":"value1",
"key2":"value2"
]
Map param = [
"map":keyValue
]
def (error,result,errorMessage) = Fx.function.executeAsyncFunc("funcCalled__c",param)
if(error){
log.error("executeAsyncFunc error: "+errorMessage)
// 1. Stop execution by throwing an exception
//Fx.message.throwException("executeAsyncFunc error: "+errorMessage)
// 2. Stop execution by return
//return;
// 3. Continue execution
}
//dosomethingNotes
- Asynchronous controller execution does not return an execution result.
2. executeOrderlyAsyncFunc Execute Asynchronous Controller Functions in Order
Fx.function.executeOrderlyAsyncFunc(<String functionApiName>, <Map param>)
Parameter Description
Input Format
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| functionApiName | String | API name of the function to execute | Yes |
| param | Map | Parameters passed when executing the function | Yes |
Groovy Example
Map keyValue = [
"key1":"value1",
"key2":"value2"
]
Map param = [
"map":keyValue
]
def (error,result,errorMessage) = Fx.function.executeOrderlyAsyncFunc("funcCalled__c",param)
if(error){
log.error("executeOrderlyAsyncFunc error: "+errorMessage)
// 1. Stop execution by throwing an exception
//Fx.message.throwException("executeOrderlyAsyncFunc error: "+errorMessage)
// 2. Stop execution by return
//return;
// 3. Continue execution
}
//dosomethingNotes
- Asynchronous execution does not return an execution result.
3. ontimeFunc Schedule Controller Function Execution
Fx.function.ontimeFunc(<String functionApiName>, <Map param>, <String runTime>)
Parameter Description
Input Format
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| functionApiName | String | API name of the function to execute | Yes |
| param | Map | Parameters passed when executing the function | Yes |
| runTime | String | Scheduled execution time | Yes |
Groovy Example
Map keyValue = [
"key1":"value1",
"key2":"value2"
]
Map param = [
"map":keyValue
]
def (error,result,errorMessage) = Fx.function.ontimeFunc("funcCalled__c",param,"2021-05-03 00:00:00")
if(error){
log.error("ontimeFunc error: "+errorMessage)
// 1. Stop execution by throwing an exception
//Fx.message.throwException("ontimeFunc error: "+errorMessage)
// 2. Stop execution by return
//return;
// 3. Continue execution
}
log.info("transactionId="+result)
//dosomethingNotes
- Scheduled execution returns a
transactionId. This value is important for troubleshooting and is recommended to be recorded.
4. asyncOnVipQueue Execute Asynchronous Tasks in an Independent Queue (Paid Feature)
Fx.function.asyncOnVipQueue(<String functionApiName>, <Map param>)
Parameter Description
Input Format
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| functionApiName | String | API name of the function to execute | Yes |
| param | Map | Parameters passed when executing the function | Yes |
Groovy Example
Map param = [
"map":[
"a": 123,
"b": "sdte"
]
]
def (error,result,errorMessage) = Fx.function.asyncOnVipQueue("func_U4Oqt__c", param)
if(error){
log.error("asyncOnVipQueue error: "+errorMessage)
// 1. Stop execution by throwing an exception
//Fx.message.throwException("asyncOnVipQueue error "+errorMessage)
// 2. Stop execution by return
//return;
// 3. Continue execution
}
log.info("traceId="+result)
//dosomethingNotes
- The return value is
traceId.
5. asyncOnVipQueue Execute Asynchronous Tasks in a Specified Independent Queue (Paid Feature)
Fx.function.asyncOnVipQueue(<String functionApiName>, <Map param>, <Integer queueIndex>)
Parameter Description
Input Format
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| functionApiName | String | API name of the function to execute | Yes |
| param | Map | Parameters passed when executing the function | Yes |
| queueIndex | Integer | Index of the target queue (starts from 0; modulo is applied when greater than purchased queue count) | Yes |
Groovy Example
Map param = [
"map":[
"a": 123,
"b": "sdte"
]
]
def (error,result,errorMessage) = Fx.function.asyncOnVipQueue("func_U4Oqt__c", param, 0)
if(error){
log.error("asyncOnVipQueue error: "+errorMessage)
// 1. Stop execution by throwing an exception
//Fx.message.throwException("asyncOnVipQueue error "+errorMessage)
// 2. Stop execution by return
//return;
// 3. Continue execution
}
log.info("traceId="+result)
//dosomethingChangelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.function API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
