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?
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”).