ebs.callRouteAsync
(FintechOS Studio 24.3.2 and later)
Executes via POST a business service component route asynchronously and returns a promise with a JSON result or an error.
Syntax
Copy
ebs.callRouteAsync(businessServiceComponentName: string, routeName: string, data: any): Promise<any>
| Parameter | Description |
|---|---|
businessServiceComponentName
|
The name of the business service component. |
routeName
|
The name of the route. |
data
|
The called data in JSON format. |
Result
It returns the called data in JSON format, as well as promise state, which can be:
- pending: initial state, neither fulfilled nor rejected.
- fulfilled: meaning that the operation was completed successfully.
- rejected: meaning that the operation failed.
Example
Get parameters from a route part of a business service component
In this example:
- we have a business service component called
bsc-endpoint-01, and its route component called withbsc-route - we run the method
ebs.callRouteAsyncand log results in the console
Copy
ebs.callRouteAsync('bsc-endpoint-01','bsc-route').then((result) => console.log(result));
Return result:
Copy
{prop1: 123, prop2: 1234, prop3: 555}
prop1: 123
prop2: 1234
prop3: 555