Query Related to JDBC Data Source

jayeshyadav252
Tera Contributor

Hi Everyone,

Recently, I came across a requirement related to loading data into a custom table through a JDBC Data Source.

Here's the scenario:

I have two tables (Table1 and Table2) present in a custom scope.


Requirement:

Once a new record is created in Table1 with the state set to "In Progress", the JDBC Data Source should trigger, load, and transform the data, then import it into the target table (Table2). Upon completion of the data import, the state of the triggering record (the Table1 record) should be set to "Complete".

What would be the correct approach to accomplish this requirement?


Thanks in advance

1 REPLY 1

pavani_paluri
Kilo Sage

HI @jayeshyadav252 ,

 

In this scenario, I wouldn't recommend triggering the JDBC Data Source directly from the Table1 record. A cleaner approach would be:

  1. Create a Business Rule or Flow on Table1 that runs when a record is created (or updated) and the State = In Progress.
  2. From there, trigger the Data Source import process (Load Data + Transform Map) using a Scheduled Import, Scripted Import, or Flow Action depending on your implementation.
  3. Once the import and transform activities complete successfully, update the corresponding Table1 record's state to Complete.
  4. In case of failures, consider updating the state to Failed/Error and logging the import details for troubleshooting.

One common pattern is to store the Table1 record's Sys ID in the import process context so that after the transform finishes (for example, in an onComplete Transform Event Script or post-import script), you can easily identify and update the triggering record.

This keeps the import process decoupled from the business transaction and provides better error handling, monitoring, and scalability.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P