Operation Steps API
Connector functions JS API guide for response objectoperation steps inmediate notification
JS API
addStep(name, result, description, stepResponseList)
Builds a step result object and adds it to the steps list in the response
global object.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
name | string | Step name. If not provided null will be set. |
result | string | Step result. If not provided null will be set. |
description | string | Step result description. If not provided null will be set. |
stepResponseList | string | StepResponse objects array. If not provided, empty array will be assigned. |
Example of use:
response.addStep('FACTORY_RESET', 'SUCCESSFUL', 'direct step from CF');
sendSteps()
Sends a step response message to the OpenGate’s operation messages flow using the steps list in the response
object, after that this list is cleaned.
Kind: global function
Returns: Void
Example of use:
response.sendSteps();
successful(statusDescription)
This method set SUCCESSFUL
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.successful("CF finished correctly");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "SUCCESSFUL",
"resultDescription": "CF finished correctly",
//...
}
}
}
errorProcessing(statusDescription)
This method set ERROR_PROCESSING
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.errorProcessing("Error executing CF");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "ERROR_PROCESSING",
"resultDescription": "Error executing CF",
//...
}
}
}
errorInParam(statusDescription)
This method set ERROR_IN_PARAM
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.errorInParam("Incorrect param from CF");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "ERROR_IN_PARAM",
"resultDescription": "Incorrect param from CF",
//...
}
}
}
notSupported(statusDescription)
This method set set NOT_SUPPORTED
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.notSupported("Not supported from CF");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "NOT_SUPPORTED",
"resultDescription": "Not supported from CF",
//...
}
}
}
errorTimeout(statusDescription)
This method set ERROR_TIMEOUT
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.errorTimeout("Timeout error from CF");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "ERROR_TIMEOUT",
"resultDescription": "Timeout error from CF",
//...
}
}
}
unknownResult(statusDescription)
This method set UNKNOWN_RESULT
stausCode with provided description.
Kind: global function
Returns: Void
Param | Type | Description |
---|---|---|
statusDescription | string | Descriptive text for result. |
Example of use:
response.unknownResult("Unknow result from CF");
response
will contain follwing data:
{
"operation": {
"response": {
//...
"resultCode": "UNKNOWN_RESULT",
"resultDescription": "Unknow result from CF",
//...
}
}
}