2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the below steps inorder to trigger an external External API within DBSync mapping:

...

  1. Create a workflow and place them as the last sequence among all the

...

  1. workflows. As a result, the trigger is initiated after completion of all

...

  1. the workflow.

...

  1. .

  2. In Query Builder, select a datasource such as database and read only one record by limiting it to 1.
    Example:select * from sku_to_qb_relation limit 1.

...


  1. Under Rules, add

...

  1. Console adapter as Target

...

  1. Connector, Operation as insert and, Console as Target object.

...


  1. Click map, and within out field, add a Java code to trigger

...

  1. External API. 
    Example: {String location="https://712c08e0.ngrok.io/appcenter/login";try{java.net.HttpURLConnection c=(java.net.HttpURLConnection)new java.net.URL(location).openConnection();c.setRequestMethod("GET");if(c.getResponseCode()==200){return new java.io.BufferedReader(new java.io.InputStreamReader(c.getInputStream())).lines().collect(java.util.stream.Collectors.joining());}}catch(java.io.IOException e){e.printStackTrace();}return "GET request did not worked";}

...


  1. Save

...

  1. and Close

...

  1. . Then, click Save

...

  1. Workflow. 

  2. Click on 'Run Now' and check output within

...

  1. the Console.