> On 14.09.2012 15:19, Christopher Nelson wrote:
>> Is there
>> some tutorial or other documentation that will tell me how listeners
>> interact with the system and with each other?
>
> One place where I've been trying to document such things is in [1].
> Unfortunately the ITicketChangeListener page is not up yet.

I appreciate you efforts and have been there a few times.  Thanks.

> I'm not aware of any other such resource. Unless the Trac source code
> counts. :)

Of course it does.  And I had seen where it gets invoked.  But more
broadly, I don't know if Trac gets executed in a single thread (so
only one instance of my listener could be active at a time) or if,
say, each user gets a thread in the server and multiple saves can
fight.

>...
>> Here's what I'm trying to do: when a field related to scheduling
>> tickets changes, do a minimal schedule recalculation.  So, if the
>> estimate for a ticket change from 8 hours to 16, any following work
>> will start a day later or this task will start a day earlier.  In the
>> latter case, I'll do all my calculations then have a new start date
>> for the ticket that the listener got invoked for.  When I save that
>> change -- inside the listener -- what happens?
>
> All ITicketChangeListener.ticket_changed() implementations get called in a
> loop at the end of Ticket.save_changes() [2].

Right.  I've seen that.

> There is no special mechanism to handle reentrancy. ITicketChangeListener is
> not meant to be used in situations where the ticket gets "manipulated"
> (="changed before saving"). Instead you should use
> ITicketManipulator.validate_ticket().

Well, I'd argue that I'm not trying to manipulate the ticket as, for
example, I think EstimationTools changes an estimate of "8" to "8.0".
I'm trying to react to changes in some fields to propagate changes to
other tickets (and, fairly often I guess, change additional fields in
the current ticket).  You could argue that a manipulator could: 1)
reschedule everything and save all other tickets, 2) set the new
schedule values in the current ticket.  But that seems awkward.

> The ITicketManipulator documentation page [3] already exists. Improvements
> are of course appreciated.
>...

That's beautiful.  Thank you.  I have not comments right now because I
just skimmed it and don't have an immediate need.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to