Get the status of a transaction group inside a script

Hi, for a critical application I need to know the status of a transaction group inside a script.

It is necessary to “stop” the processing if the transaction group is failing for any reason.

I was expecting there was a system function to check that but I did not find it.

The only solution I saw is proposed here: Get status of transaction group. It surely can work but honestly I would prefer to something more “deterministic”. I found quite strange that the transaction group status is clear inside the designer ,however it is not possibile to check at run time.

Thanks for your support.

Elio Cutino

No, not available. If you need more features than transaction groups offer, you can re-implement with a gateway timer script or tag change event.

Hi Phil, sorry not clear.

As per my second email, the “Handshake on failure” in not writing the tag whenever is triggered and, by example, the DB is not available and the transaction group is failing.

a) What do I have to re-implelement?
b) Why the tag associated to the “on failure” is not written and vice versa also if the Transaction group is failing is written the “on success”

Please re-check my screenshot and second email about.

Many thanks

Elio Cutino

Via Carlone, 5 - 20147 Milano
Tel./Fax: +39 02 40 72 249
Mobile: +39 331 68 20 142
e-mail: e.cutino@modula.it
Web: www.modula.it

a) You write a script function that uses a combination of system.tag.readBlocking and system.opc.readValues to obtain all of your sample data. You compute any other items with jython and that sample data. You insert to the database with system.db.runPrepUpdate. You wrap the entire function in a try-except block. You call that function from a tag change event or a timer event.

b) Transaction group “write on failure” only writes when the DB has an error in the statement execution. Not if the DB wasn’t available at all. And as noted in the other topic, that failure requires a manual restart. In other words, you can’t get the level of monitoring you want.

I don’t see any screenshot from you.

Consider replying on the forum instead of by email if you can’t eliminate your signature block. Those are against the forum rules (see “Keep it Tidy” in the FAQ).

Ok Phil, thanks. Sorry for the answer, I got confused with a request of support via email too.

Clear and it is as you said, but honestly “tough” to understand that a DB unavailable/disabled can bring to a “success” in the TG execution…

E.

No, I don’t think you get either signal.

Hi Phil, sorry but point B) is not exactly true. If I drop the table (with automatically create table = false) as I did, surely the SQL statement (insert) will run in error but the “write on failure” is not writing in the associated tag.

One more reason to re-implement as a script, then.

Sorted out: setting in the Transaction Group → Option the “by pass of Store & Forward” all the unsuccessful transactions with the DB are triggering the “Failure” tag. Practically, the S&F acts as a “buffer” also in (temporary) absence of the DB