Skip to main content
swapnar6405
March 29, 2023
Question

Saving data to a using gateways, write to data store entities in a process model

  • March 29, 2023
  • 3 replies
  • 0 views

Hi,

I have the below scenario. I have a master table to which I have to save the data initially. Later if any of the child tables have data then I need to store into respective tables. Also, I have to save the master table autogenerated key column into the child tables.

Can someone advise, if I have to use any specific smart services to achieve this. Thanks in advance.

3 replies

March 30, 2023

You can add a script task after Master WDSE to prepare data for both of the child tables and set the primary key from Master table in child table fields and then use Write to Multiple DSE smart service to write the data into both child entities at once by passing an array of a!entityData in valueToStore input node.

The best practice here is to not use the WDSE smart service directly in your process but to use a subprocess with a null handling in it.

You may find this useful Write to Multiple DSE smart service, let me know if you have any other queries related to this. 

harshitb6843
March 30, 2023

I would not advice using write to multiple DSE that become harder to resue. Instead, use two sub-processes, one for each child table, and write the values. That way, you will be able to reuse these sub processes in other parts of the App as well where you may want to write values in any one of both of these tables. 

March 30, 2023

Indeed absolutely.

I recommended WMDSE just because he/she asked if there is any specific smart service for this.

Is it recommended to use subprocess for WMDSE and create a pv! of type entityData? that way it can be reusable up to some extent.