-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Meeker wrote:
> I am starting to dig into how workflows are implemented with the goal
> of implementing #7709 from Trac-Hacks[1].

Thanks for facing the challenge. This is really useful stuff.

> The end result should be
> that actions not defined by the workflow will be disallowed and any
> operations the action defines should be applied.

- From end user perspective I would most probably expect kind of selection
(drop-down?) ordered by action priority (as configured) leaving me, the
end user, with only the choice among valid actions. So you still need
the data requested, but you'll need it on ticket selection well *before*
committing the set of changes.

> I am looking at the
> ITicketActionController interface and its implementation in
> ConfigurableTicketWorkflow. Is there a straightforward way to ask,
> given a ticket and a status, if it is valid for the ticket to be
> transitioned to that status? I haven't been able to find this type of
> validation being done anywhere else (and didn't really expect to).

modules
 get_ticket_actions(req, ticket) and
 get_all_status()
in
 class ITicketActionController(Interface)

should just give you all the needed information.

> Right now I have a (buggy) hack that uses the internals of
> ConfigurableTicketWorkflow, but that could easily break for other
> implementations of ITicketActionController. It keeps track of which
> tickets have an invalid transition. If any are invalid the entire
> transaction is rolled back and an error is raised describing which
> tickets are invalid.
> 
> [1]: http://trac-hacks.org/ticket/7709

Once again, I'd recommend pre-selecting valid actions and corresponding
statuses beforehand, so you'll know, the user choice will always be
valid, same way as ticket view page does for a single ticket.

Steffen Hoffmann
(hasienda)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkzPEaQACgkQ31DJeiZFuHfiyACg0dEUdH/CTUlXvK/+NksEkZdp
K2MAn1akXdcHQog1hepvCrM7KWjKwbYf
=lmY1
-----END PGP SIGNATURE-----

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

Reply via email to