Edgewall Software
Modify

Opened 11 years ago

Last modified 16 months ago

#5866 new enhancement

[patch] Workflow tweak: handle "not-state" transition specifications

Reported by: Morris Owned by:
Priority: low Milestone: unscheduled
Component: ticket system Version: devel
Severity: normal Keywords: patch workflow state
Cc: gt4329b@…, jevans, kace25_2000@…
Release Notes:
API Changes:

Description (last modified by Ryan J Ollos)

I found myself wanting things like this in my [ticket-workflow]:

reassign = * -> * 
reassign.operations = set_owner,leave_status 
reassign.permissions = TICKET_MODIFY 

needinfo = * -> needinfo 
needinfo.name = need info 
needinfo.operations = set_owner 
needinfo.permissions = TICKET_MODIFY

…but this would create two action options for a ticket in the "needinfo" state: "reassign and leave as needinfo", and "assign to new owner and leave as needinfo" …which are of course the same thing. I wanted to be able to do this instead:

needinfo = *,!needinfo -> needinfo 
needinfo.name = need info 
needinfo.operations = set_owner 
needinfo.permissions = TICKET_MODIFY

This would indicate that the "needinfo" state was a valid next state from every other state except "needinfo". To make this work, make the following tweak to /trac/ticket/default_workflow.py (line 161):

 if oldstates == ['*'] or status in oldstates:

…becomes…

 if ('*' in oldstates or status in oldstates) and ("!%s"%status not in oldstates):

I haven't tested this extensively, and even though it should be backwards-compatible… use with extra initial scrutiny.

Attachments (0)

Change History (10)

comment:1 Changed 11 years ago by ThurnerRupert

hmm … would it be possible to extend it more "workflow like" (http://wfmc.org)?

i.e., currently operations exist for the arrows. the other possibility wuold be to have operations on the nodes:

  • automatically executed preops (before entering the node)
  • automatically executed postops (before leaving the node)
  • choosable actions (possible when in the node), like "set_owner"

added some brainstorming at the bottom of TracWorkflow. see also #5865.

comment:2 Changed 10 years ago by Remy Blank

Milestone: 1.0

Interesting idea.

comment:3 Changed 10 years ago by jevans

Cc: jevans added

Seems like this makes a lot of sense.

Another example

close = *,!closed -> closed

Could it be scheduled a bit sooner than 1.0?

Last edited 16 months ago by Ryan J Ollos (previous) (diff)

comment:4 Changed 8 years ago by Christian Boos

Milestone: 1.0unscheduled

Milestone 1.0 deleted

comment:5 Changed 8 years ago by Christian Boos

Milestone: triagingunscheduled

Milestone triaging deleted

comment:6 Changed 8 years ago by Eli Carter

Cc: kace25_2000@… added

#9547 was duplicate of this ticket; adding that reporter to this ticket.

comment:8 Changed 3 years ago by Ryan J Ollos

Owner: Jonas Borgström deleted

comment:9 Changed 3 years ago by figaro

Keywords: patch added

comment:10 Changed 16 months ago by Ryan J Ollos

Description: modified (diff)

comment:11 Changed 16 months ago by Ryan J Ollos

* implies all the set of all states, and !<state> is only needed to subtract from a set of all states. Therefore I think we could have !<state> imply all states except <state> (i.e. * - <state>). The following patterns would then be valid:

  • * -> newstate: a transition from all states
  • !oldstate1,!oldstate2 -> newstate: a transition from all states except oldstate1, oldstate2
  • oldstate1,oldstate2 -> newstate: a transition from oldstate1, oldstate2

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.