Changes between Version 13 and Version 14 of MultipleWorkflowPlugin


Ignore:
Timestamp:
May 2, 2015, 8:34:28 AM (9 years ago)
Author:
Cinc-th
Comment:

Added example for custom workflow. Explained how to add statuses to query page.

Legend:

Unmodified
Added
Removed
Modified
  • MultipleWorkflowPlugin

    v13 v14  
    1616[http://trac-hacks.org/newticket?component=MultipleWorkflowPlugin&owner=ermal new ticket].
    1717
     18[[TicketQuery(component=MultipleWorkflowPlugin&group=type,format=progress)]]
     19
    1820== Download ==
    1921
     
    2426You can check out MultipleWorkflowPlugin from [http://trac-hacks.org/svn/multipleworkflowplugin here] using Subversion, or [source:multipleworkflowplugin browse the source] with Trac.
    2527
    26 == Example ==
     28== Installation ==
    2729
    2830Enable the plugin with:                                                               
     
    3739}}}
    3840
    39 For using it you should have in the trac.ini file the [ticket-workflow] session because when a section for a ticket type doesn't exist trac uses the [ticket-workflow] for the actions to do.
    40 If you want to define different workflows than you should create in trac.ini sections called [ticket-workflow-ticket_type] where ticket_type is the type of ticket you want to use this section,you can create all the sections you want and trac will use them when that kind of ticket is being used,you can create ticket type in the admin pannel under ticket types.
     41== Example ==
     42For using it you should have the {{{[ticket-workflow]}}} section in your ''trac.ini'' file because when a custom section for a ticket type doesn't exist that one is used.
     43
     44To define a different workflow for a ticket with type {{{Requirement}}} create a section in ''trac.ini'' called {{{[ticket-workflow-Requirement]}}} and add your workflow items:
     45
     46{{{
     47[ticket-workflow-Requirement]
     48leave = * -> *
     49leave.default = 1
     50leave.operations = leave_status
     51
     52approve = new, reopened -> approved
     53approve.operations = del_resolution
     54approve.permissions = TICKET_MODIFY
     55
     56reopen_verified = closed -> reopened
     57reopen_verified.name= Reopen
     58reopen_verified.operations = set_resolution
     59reopen_verified.set_resolution=from verified
     60reopen_verified.permissions = TICKET_MODIFY
     61
     62reopen_approved = approved -> reopened
     63reopen_approved.name = Reopen
     64reopen_approved.operations = set_resolution
     65reopen_approved.set_resolution=from approved
     66reopen_approved.permissions = TICKET_CREATE
     67
     68remove = new, reopened, approved, closed -> removed
     69remove.name=Remove this Requirement permanently
     70remove.operations = set_resolution
     71remove.set_resolution= removed
     72remove.permissions = TICKET_MODIFY
     73
     74verify = approved -> closed
     75verify.name=Verifiy the Requirement and mark
     76verify.operations = set_resolution
     77verify.set_resolution=verified
     78verify.permissions = TICKET_MODIFY
     79}}}
     80
     81This results in the following workflow:
     82
     83{{{
     84#!Workflow width=900 height=400
     85leave = * -> *
     86leave.default = 1
     87leave.operations = leave_status
     88
     89approve = new, reopened -> approved
     90approve.operations = del_resolution
     91approve.permissions = TICKET_MODIFY
     92
     93reopen_verified = closed -> reopened
     94reopen_verified.name= Reopen
     95reopen_verified.operations = set_resolution
     96reopen_verified.set_resolution=from verified
     97reopen_verified.permissions = TICKET_MODIFY
     98
     99reopen_approved = approved -> reopened
     100reopen_approved.name = Reopen
     101reopen_approved.operations = set_resolution
     102reopen_approved.set_resolution=from approved
     103reopen_approved.permissions = TICKET_CREATE
     104
     105remove = new, reopened, approved, closed -> removed
     106remove.name=Remove this Requirement permanently
     107remove.operations = set_resolution
     108remove.set_resolution= removed
     109remove.permissions = TICKET_MODIFY
     110
     111verify = approved -> closed
     112verify.name=Verifiy the Requirement and mark
     113verify.operations = set_resolution
     114verify.set_resolution=verified
     115verify.permissions = TICKET_MODIFY
     116}}}
     117
     118== Add Custom Statuses to Query Page ==
     119Your custom statuses are normally not available on the Trac query page for filtering tickets.
     120
     121Trac core only looks at the default workflow when gathering the statuses (for obvious reasons since it doesn't know about your private workflow).
     122
     123To have your custom status appear which is defined in {{{[ticket-workflow-my_type]}}} add it to the default section {{{[ticket-workflow]}}} like this:
     124
     125{{{
     126[ticket-workflow]
     127[...]
     128# The following are from other workflows. By including them here they will show up
     129# as a selectable item on the ticket query page.
     130approve = approved -> approved
     131remove = removed -> removed
     132[...]
     133}}}
     134
     135Because there is no transition to the statuses {{{approved}}} and {{{removed}}} in the default workflow these items will never show up as a selectable item on the ticket page of standard tickets, yet you see them on the query page.
    41136
    42137