# Get the status of a transaction group inside a script

**URL:** <https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534>\
**Category:** Ignition\
**Created:** [August 1, 2022, 7:46am UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534 "2022-08-01T07:46:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [August 1, 2022, 7:46am UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/1 "2022-08-01T07:46:42Z")

</div>

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](https://forum.inductiveautomation.com/t/get-status-of-transaction-group/29327). 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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 1, 2022, 11:45am UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/2 "2022-08-01T11:45:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [August 1, 2022, 12:05pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/3 "2022-08-01T12:05:39Z")

</div>

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

![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/9/a9de0e106aa7df51aa99cf63d619bd2bb5fbca75.png)

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 1, 2022, 12:22pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/4 "2022-08-01T12:22:13Z")

</div>

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](https://forum.inductiveautomation.com/faq)).

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [August 1, 2022, 1:29pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/5 "2022-08-01T13:29:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 1, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/6 "2022-08-01T14:28:12Z")

</div>

> [@e.cutino](#):
>
> can bring to a “success” in the TG execution

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

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [August 1, 2022, 2:30pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/7 "2022-08-01T14:30:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 1, 2022, 3:54pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/8 "2022-08-01T15:54:00Z")

</div>

> [@e.cutino](#):
>
> not exactly true

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

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [August 2, 2022, 12:46pm UTC](https://forum.inductiveautomation.com/t/get-the-status-of-a-transaction-group-inside-a-script/62534/9 "2022-08-02T12:46:29Z")

</div>

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
