Edgewall Software

Changes between Version 7 and Version 8 of WorkFlow/Examples


Ignore:
Timestamp:
Apr 27, 2017, 1:49:23 AM (5 years ago)
Author:
Ryan J Ollos
Comment:

Update to use Workflow macro. See also comment:5:ticket:11865.

Legend:

Unmodified
Added
Removed
Modified
  • WorkFlow/Examples

    v7 v8  
    55As described in TracWorkflow with all its known quirks:
    66
    7 [[Image(WorkFlow:original-workflow.large.png)]]
    8 
     7{{{#!Workflow
     8[ticket-workflow]
     9; original-workflow.ini
     10
     11; create the ticket:  -> New, owner set to component default or "somebody"
     12
     13; New:
     14;   leave as new
     15;   accept ticket -> assigned state, owner set to self, shows up as accepted.
     16;   resolve as:   -> closed, resolution_set
     17;   reassign to:
     18;
     19; Assigned:
     20;   leave as assigned
     21;   resolve as:
     22;   reassign to: -> new state, not accepted
     23;
     24; Closed:
     25;   leave as closed
     26;   reopen ticket -> reopened, resolution_del
     27;
     28; Reopened:
     29;   leave as reopened
     30;   resolve as:
     31;   reassign to: -> new, owner_set
     32
     33; This is action-centric
     34leave = * -> *
     35leave.operations = leave_status
     36leave.default = 1
     37
     38accept = new -> assigned
     39accept.permissions = TICKET_MODIFY
     40accept.operations = set_owner_to_self
     41
     42resolve = new,assigned,reopened -> closed
     43resolve.permissions = TICKET_MODIFY
     44resolve.operations = set_resolution
     45
     46reassign = new,assigned,reopened -> new
     47reassign.permissions = TICKET_MODIFY
     48reassign.operations = set_owner
     49
     50reopen = closed -> reopened
     51reopen.permissions = TICKET_CREATE
     52reopen.operations = del_resolution
     53}}}
    954
    1055== Basic ([source:trunk/trac/ticket/workflows/basic-workflow.ini basic-workflow.ini]) ==
     
    1257This is an improved version of the original workflow:
    1358
    14 [[Image(basic-workflow.medium.png)]]
     59{{{#!Workflow
     60[ticket-workflow]
     61; basic-workflow.ini
     62;
     63; This workflow is intended to be a "fixed" version of the original workflow.
     64;
     65; If you adopt it for an existing Trac environment, don't forget to convert
     66; the status of your existing tickets.
     67;
     68; Both the setup of the new [ticket-workflow] and the migration can be achieved
     69; by using the following script:
     70;
     71; contrib/workflow/migrate_original_to_basic.py
     72
     73leave = * -> *
     74leave.operations = leave_status
     75leave.default = 1
     76
     77create = <none> -> new
     78create.default = 1
     79
     80create_and_assign = <none> -> assigned
     81create_and_assign.label = assign
     82create_and_assign.permissions = TICKET_MODIFY
     83create_and_assign.operations = may_set_owner
     84
     85accept = new,assigned,accepted,reopened -> accepted
     86accept.permissions = TICKET_MODIFY
     87accept.operations = set_owner_to_self
     88
     89resolve = new,assigned,accepted,reopened -> closed
     90resolve.permissions = TICKET_MODIFY
     91resolve.operations = set_resolution
     92
     93reassign = new,assigned,accepted,reopened -> assigned
     94reassign.permissions = TICKET_MODIFY
     95reassign.operations = set_owner
     96
     97reopen = closed -> reopened
     98reopen.permissions = TICKET_CREATE
     99reopen.operations = del_resolution
     100
     101[milestone-groups]
     102closed = closed
     103closed.order = 0
     104closed.query_args = group=resolution
     105closed.overall_completion = true
     106
     107active = *
     108active.order = 1
     109active.css_class = open
     110
     111new = new,reopened
     112new.order = 2
     113}}}
    15114
    16115What it means for a ticket to be "accepted" is left open for interpretation.
    17116
    18 
    19117== Simple ([source:trunk/contrib/workflow/simple-workflow.ini simple-workflow.ini]) ==
    20118
    21119Very simple workflow, suitable for single user Trac environments:
    22120
    23 [[Image(WorkFlow:simple-workflow.large.png)]]
    24 
     121{{{#!Workflow
     122[ticket-workflow]
     123; simple-workflow.ini
     124
     125; This is action-centric
     126leave = * -> *
     127leave.operations = leave_status
     128leave.default = 1
     129
     130create = <none> -> new
     131
     132resolve_new = new -> closed
     133resolve_new.label = resolve
     134resolve_new.permissions = TICKET_MODIFY
     135resolve_new.operations = set_owner_to_self,set_resolution
     136
     137accept = new,accepted -> accepted
     138accept.permissions = TICKET_MODIFY
     139accept.operations = set_owner_to_self
     140
     141resolve_accepted = accepted -> closed
     142resolve_accepted.label = resolve
     143resolve_accepted.permissions = TICKET_MODIFY
     144resolve_accepted.operations = set_resolution
     145
     146unaccept = accepted -> new
     147unaccept.permissions = TICKET_MODIFY
     148unaccept.operations = del_owner
     149
     150reopen = closed -> new
     151reopen.permissions = TICKET_CREATE
     152reopen.operations = del_resolution
     153}}}
    25154
    26155== Trivial ([source:trunk/contrib/workflow/trivial-workflow.ini trivial-workflow.in]) ==
     
    28157A very simple workflow, for illustration purposes only:
    29158
    30 [[Image(WorkFlow:trivial-workflow.large.png)]]
    31 
     159{{{#!Workflow
     160[ticket-workflow]
     161; trivial-workflow.ini
     162
     163create = <none> -> new
     164
     165resolve = new -> closed
     166resolve.permissions = TICKET_MODIFY
     167resolve.operations = set_resolution
     168
     169reopen = closed -> new
     170reopen.permissions = TICKET_CREATE
     171reopen.operations = del_resolution
     172
     173leave = * -> *
     174leave.operations = leave_status
     175leave.default = 1
     176}}}
    32177
    33178== !OpenSource ([source:trunk/contrib/workflow/opensource-workflow.ini opensource-workflow.ini]) ==
     
    35180Comprehensive workflow which is adapted to the way we work with tickets in the Trac project:
    36181
    37 [[Image(opensource-workflow.medium.png)]]
     182{{{#!Workflow
     183[ticket-workflow]
     184; opensource-workflow.ini
     185
     186; create action
     187create = <none> -> new
     188
     189; accept action
     190; When you accept a ticket, you get ownership of it.  (You can't accept a
     191; ticket on someone else's behalf.)
     192accept = new,assigned,accepted,started -> accepted
     193accept.operations = set_owner_to_self
     194accept.permissions = TICKET_MODIFY
     195
     196; assign, reassign, unassign actions
     197assign = new -> assigned
     198assign.operations = set_owner
     199assign.permissions = TICKET_MODIFY
     200
     201reassign = assigned,accepted,started -> assigned
     202reassign.operations = set_owner
     203reassign.permissions = TICKET_MODIFY
     204
     205; Allow correcting the ownership of a closed ticket.
     206change_owner = closed -> closed
     207change_owner.label = change ownership
     208change_owner.operations = set_owner
     209change_owner.permissions = TICKET_MODIFY
     210
     211unassign = assigned,accepted,started -> new
     212unassign.operations = del_owner
     213unassign.permissions = TICKET_MODIFY
     214
     215; leave actions
     216leave = * -> *
     217leave.operations = leave_status
     218leave.default = 1
     219
     220; resolve actions
     221resolve = new,assigned,accepted,started -> closed
     222resolve.operations = set_resolution
     223resolve.permissions = TICKET_MODIFY
     224
     225; start/stop actions
     226start = accepted,assigned -> started
     227start.operations = set_owner_to_self
     228start.permissions = TICKET_MODIFY
     229
     230stop = started -> assigned
     231stop.permissions = TICKET_MODIFY
     232
     233; reopen actions
     234reopen = closed -> new
     235reopen.operations = del_resolution
     236reopen.permissions = TICKET_CREATE
     237
     238; request info actions
     239; For tickets with an owner, they go back to assigned
     240request_info = assigned,accepted,started -> infoneeded
     241request_info.permissions = TICKET_MODIFY
     242
     243provide_info = infoneeded -> assigned
     244provide_info.permissions = TICKET_MODIFY
     245provide_info.default = 2
     246
     247; But tickets without an owner go back to new.
     248request_info_new = new -> infoneeded_new
     249request_info_new.label = request info
     250request_info_new.permissions = TICKET_MODIFY
     251
     252provide_info_new = infoneeded_new -> new
     253provide_info_new.label = provide info
     254provide_info_new.permissions = TICKET_MODIFY
     255provide_info_new.default = 2
     256}}}
    38257
    39258Probably suitable for other open source projects as well, where work must be coordinated between loosely coupled developers.
     
    43262Comprehensive workflow with a QA (Quality Assurance) stage:
    44263
    45 [[Image(enterprise-workflow.medium.png)]]
     264{{{#!Workflow
     265[ticket-workflow]
     266; enterprise-workflow.ini
     267
     268; create actions
     269create = <none> -> new
     270create.default = 1
     271
     272create_and_assign = <none> -> assigned
     273create_and_assign.label = assign
     274create_and_assign.operations = may_set_owner
     275create_and_assign.permissions = TICKET_MODIFY
     276
     277; assign, reassign, unassign actions
     278assign = new -> assigned
     279assign.operations = set_owner
     280assign.permissions = TICKET_MODIFY
     281
     282reassign = assigned,in_work -> assigned
     283reassign.operations = set_owner
     284reassign.permissions = TICKET_MODIFY
     285
     286reassign_closed = closed -> closed
     287reassign_closed.label = reassign
     288reassign_closed.operations = set_owner
     289reassign_closed.permissions = TICKET_MODIFY
     290
     291unassign = assigned,in_work -> new
     292unassign.operations = del_owner
     293unassign.permissions = TICKET_MODIFY
     294
     295; leave actions
     296leave = * -> *
     297leave.operations = leave_status
     298leave.default = 1
     299
     300; test actions
     301test = new,assigned,in_work -> in_QA
     302test.permissions = TICKET_MODIFY
     303
     304; resolve actions
     305resolve = in_QA -> closed
     306resolve.operations = set_resolution
     307resolve.permissions = TICKET_MODIFY
     308
     309fail = in_QA -> assigned
     310fail.permissions = TICKET_MODIFY
     311
     312; start/stop actions
     313start = assigned -> in_work
     314start.operations = set_owner_to_self
     315start.permissions = TICKET_MODIFY
     316
     317stop = in_work -> assigned
     318stop.permissions = TICKET_MODIFY
     319
     320; reopen actions
     321reopen = closed -> new
     322reopen.operations = del_resolution
     323reopen.permissions = TICKET_CREATE
     324
     325; request info actions
     326; For tickets with an owner, they go back to assigned
     327request_info = assigned,in_work,in_QA -> infoneeded
     328request_info.permissions = TICKET_MODIFY
     329
     330provide_info = infoneeded -> assigned
     331provide_info.permissions = TICKET_MODIFY
     332provide_info.default = 2
     333
     334; But tickets without an owner go back to new.
     335request_info_new = new -> infoneeded_new
     336request_info_new.label = request info
     337request_info_new.permissions = TICKET_MODIFY
     338
     339provide_info_new = infoneeded_new -> new
     340provide_info_new.label = provide info
     341provide_info_new.permissions = TICKET_MODIFY
     342provide_info_new.default = 2
     343}}}