Configuring Invoke API Task
In relation to the API widget, this post focuses on how to configure an API instance for a task. In the vDesigner module, when you design an application, you impart the function behavior to the app by configuring several events in the app.
When you configure an event, you configure one or more tasks in the event to impart full functional behavior to the app. In the similar fashion, to consume an API, you can configure Invoke API task in an event.
When a user performs a function on a related element, the configured event triggers and then executes the Invoke API task. After the event executes the Invoke API task, it invokes the configured API so that the API performs the intended job.
To configure the Invoke API task:
- On the vDesigner app’s dashboard, see the left navigation panel.
- In the left navigation panel, see the Task Group icon ().
- Click the Task Group icon, and a dialog box opens.
- In the dialog box, click Proceed if you have saved changes in the application, the middle panel displays the Task Group Manager page.
Note:- If you have not saved the unsaved changes in the application, click Cancel to close the dialog box and save changes, and then click the Task Group icon to access the Task Group Manager page.
- The Task Group Manager page displays the list of earlier created task groups.
- Under the Name column, find a task group (for example, Task_GRP_1).
- After you find the task group, put the mouse pointer on its name (for example, Task_GRP_1), and an Edit icon () comes into view.
- Click the Edit icon (), and the <<Task Group Name>> page opens.
- On the <<Task Group Name>> page, see the Task panel.
- In the Task panel, in the Search box, enter Invoke API.
- After you find the Invoke API task, drag it to the Execution panel.
- After you drag the task to the Execution panel, the Invoke API task expands and then displays a group of properties.
- Configure these properties as follows:
Properties | Description | Mandatory |
Reference Name | By default, this box displays the unique reference name of the task. You can also enter a new reference name for the task. The vDesigner module uses the reference name to manage the task at the app level. | Yes |
API | This property allows you to select an API’s instance. After you select an API’s instance, the app invokes this API as a result of the user’s action. To select an API: a. In the API box, click the application tree icon (), and the APIs panel comes into view. b. The APIs panel displays one or more APIs in tile format. c. In the APIs panel, click to select an API that you want the app to invoke after the user performs the related function in the app. d. After you select the API, an Info panel comes into view and then displays the details of the selected API. e. After you make sure that the API’s details are correct, click Select to configure the API. f. After you configure the API, the API box starts displaying its name. | Yes |
Business Rule | This property allows you to build a business rule related to the task’s execution. If the user’s action satisfies the condition in the business rule, the Invoke API task is executed. To configure the business rule: a. In the Business Rule box, click the application tree icon (), and the Business Rule panel opens. b. In the Business Rule panel, click CreateNew to configure the new business rule. |
- After you configure the related properties, click Save to configure the Invoke API task.