Can Table Creator receive an input? How can I export specific files or tables depending on whether "DB Transaction End" was successful or not?

I have DB Transaction Start and DB Transaction End nodes.

The DB Transaction End node has one output port for successful (committed) database transactions, and one for the unsuccessful ones.

I want to write a log (to a text file and/or to a log table in my database) when a transaction is successful or not. But how do I do it?
Something that tells me: on date such and such this operation succeeded, this other on failed because of XYZ etc

What I have tried:

  • I have tried the SQL Executor Node but I cannot connect it to the output ports of “DB Transaction End”.
  • I have tried the Table Creator node, but that has no input ports.
  • I have tried to connect DB Transaction End to the top of the Table Creator Node anyway (see picture below), but this causes an X to appear on the output port of Table Creator; what does it mean?

image

Hi @YetAnotherOne -

Here’s one way you could do it. The key is manipulation of flow variables prior to writing them to a separate transaction result table. In the example below, on failure (bottom branch) we pull in the error message from the DB, along with a timestamp that we create. On success (top branch), we write a generic success message along with the timestamp.

The X marks over flow ports just indicate an inactive branch of your workflow. Since success or failure will always be a mutually exclusive result, one of the branches will always have X marks (along with colorless “traffic lights”).

3 Likes

Here’s the result of 2 transactions from my toy example:

Thank you. I suppose you are using FailingNodeMessage or FailingNodeStackTrace as the variables to output?

FailingNodeMessage in this case, yes.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.