This article describes OData 2.0 connector usage in webMethods.io Integration with OData connector use case.
Use case:
Get the list of products from public OData backend services and write them to new CSV file if data is more than 20 records file name appends with the date and if less than 20 records update the existing CSV file.
Steps:
Create Account:
- Add Account by clicking on + icon at “Connect to OData v2.0”
- And then provide account details.
- Let's use below generic test account for the demo purpose
URL : http://services.odata.org/(S(1hge4mn2zqwrcatw55e5na0w))/V2/OData/OData.svc
Action:
We can choose existing actions or can create new custom actions.
Let’s create a new custom action for getting the listing of products.
- Click on + icon at “Select Action” to create a new custom action. Provide required inputs and choose account configured above.
- Choose the action to perform
- Choose the business object as products
- Select the data fields
- Preview the action details and confirm
- Click on Done button
- Click on the Test button to test the action
- Add the “JSON to CSV”, switch and file operation developer utilities from right side pallet.
- Configure the workflow as below
- Configure the switch condition for case1 to create a new file if no of products are grater than 20.
- Click on the Play icon to execute the workflow.
- It also shows a graphic view of execution as below at each step.