Here’s the workflow flow I’m using.
<atomic-commit>
<dataset name="foo"/>
</atomic-commit>
<dataset-iterator dataset="foo">
<create-row dataset="hist-foo"/>
<mark-row-created dataset="hist-foo"/>
</dataset-iterator>
So basically, after dataset foo is updated, I want to record the remaining foo entries in another history table. But when I delete rows from the foo table, the rows still remain in the dataset and therefore get added to hist-foo.
I’ve tried to add a post-workflow to the foo databroker’s delete action like this:
<workflow>
<delete-row dataset="{$context.commit-dataset-name}"/>
</workflow>
However I get an error when the delete action is called.
Also, after the first atomic commit, the foo dataset doesn’t keep deleted row actions, so I can’t identify which rows from deleted from the dataset.
The simplest solution for this situation would be to sift the marked-deleted rows into a separate dataset. Unfortunately this is a little long when using only built-in commands.
An alternate solution would be to do the history recording at the same time as the inserts/updates were run, for example by running multiple statements within the operations or by having insert/update triggers set up if those are available.