[rt-users] TransactionBatch Question

Ruslan Zakirov ruslan.zakirov at gmail.com
Mon Jun 1 18:19:35 EDT 2009


On Mon, Jun 1, 2009 at 10:15 PM, Stephen Turner <sturner at mit.edu> wrote:
> On Mon, 01 Jun 2009 13:55:23 -0400, Ruslan Zakirov
> <ruslan.zakirov at gmail.com> wrote:
>
>> On Mon, Jun 1, 2009 at 6:01 PM, Stephen Turner <sturner at mit.edu> wrote:
>>>
>>> I'm playing with the TransactionBatch feature and I'm curious: if you use
>>> $self->TransactionObj in a custom scrip condition for a TransactionBatch
>>> scrip, what do you get? My understanding is that this stage does not
>>> execute in the context of a transaction.
>>
>> It does, you get first transaction that matched the condition, so
>> not-batch-mode-aware scrips can still work as expected.
>>
>>
>
> Ah, thanks, I almost understand it now! So, is the scrip invoked once per
> transaction until a transaction matches the scrip condition?
>
> I'm testing with a simple scrip that just returns a value from the custom
> condition, and I update a ticket with status change and two CF changes. If
> the scrip returns 0, I see the scrip being invoked three times, once for
> each of the field-change transactions. If the scrip returns 1, it runs only
> once.

Steve, sorry, but I can't say that I fully understand your
description, but conditions of batch scrips tested on every
transaction in a batch, but process stops as soon as we find a match.
We don't want to fire the same scrip multiple times on the same batch.

For example batch has status, queue and two cfs change.
* If a condition fires its scrip on correspond then the scrip action
wouldn't be applied. All txns in the batch would be checked against
the condition.
* if a condition fires its scrip on queue change then the scrip action
would be applied and default transaction accessor will point to queue
change. The condition wouldn't be checked against cf changes.
* if a condition fires its scrip on any cf change then the scrip
action would be applied and default transaction accessor will point to
the first cf change. The condition wouldn't be checked against other
transacactions after the first change in a cf.

Something like that, hope it helps.


>
> Steve
>



-- 
Best regards, Ruslan.



More information about the rt-users mailing list