Edgewall Software

Changes between Version 12 and Version 13 of WorkFlow


Ignore:
Timestamp:
Jan 29, 2006, 4:18:07 AM (18 years ago)
Author:
Alec Thomas
Comment:

Documented TracIni configurable workflow and basics of extension point

Legend:

Unmodified
Added
Removed
Modified
  • WorkFlow

    v12 v13  
     1[[PageOutline]]
    12= Workflow Discussion =
    23
     
    2021 * Remove `ticket_custom_props()` macro? It does not appear to be referenced.
    2122 * There are a number of locations in the ticket code where permissions are hard coded. As an example, the `TICKET_CREATE` permission is required to create a new ticket. Should this be overridable by `ITicketWorkflow` implementors?
     23
     24== Basic Configurable Workflow ==
     25Basic workflow configuration is possible in TracIni through two new sections,
     26`ticket-status` and `ticket-actions`. This configurability is limited to defining
     27ticket actions and status states and their transitions with basic permission
     28enforcement.
     29
     30=== Defining available actions for a status ===
     31Each key under the `ticket-status` section is a ticket status and the value associated with each key is the actions available.
     32
     33{{{
     34[ticket-status]
     35assigned = leave resolve reassign
     36closed = leave reopen retest
     37new = leave resolve reassign accept
     38reopened = leave resolve reassign
     39resolved = leave reassign reopen verify
     40verified = leave reassign reopen retest close
     41}}}
     42
     43=== Mapping actions to resulting statuses ===
     44
     45The `ticket-actions` section defines what the status resulting from an action
     46will be, in addition to the permission required for that action.
     47
     48{{{
     49[ticket-actions]
     50accept = assigned
     51close = closed
     52close.permission = TRAC_ADMIN
     53reassign = new
     54reopen = reopened
     55reopen.permission = TICKET_ADMIN
     56resolve = resolved
     57retest = resolved
     58retest.permission = TICKET_ADMIN
     59verify = verified
     60}}}
     61
     62== Plugabble Workflow ==
     63For more complex ticket workflow requirements an extension point is available,
     64allowing full control of the ticket workflow process.
     65
     66{{{
     67#!python
     68class ITicketWorkflow(Interface):
     69    """ This interface controls what actions can be performed on a ticket and
     70        also a list of the available ticket fields. """
     71
     72    # Control ticket actions
     73    def get_ticket_actions(req, ticket):
     74        """ Return the actions that are available given the current state of
     75            ticket and the request object provided. """
     76
     77    def get_ticket_action(req, ticket, action):
     78        """ Return a trac.ticket.field.Field object for ticket action. """
     79
     80    def apply_ticket_action(req, ticket, action):
     81        """ Perform action on ticket. """
     82
     83    # Control ticket fields
     84    def filter_ticket_fields(req, ticket, fields):
     85        """ Given a list of ticket.Field objects and a ticket, return the
     86            filtered list of fields. This method must enforce permission
     87            control on all fields. """
     88
     89    def update_ticket_fields(req, ticket):
     90        """ Apply changes in req to ticket. By default this should simply be
     91            `ticket.populate(req.args)`. """
     92}}}
    2293
    2394== Available Field Types and Options ==