| 1 | == Extension Point : ''ITicketActionController'' == |
| 2 | |
| 3 | ||'''Interface'''||''ITicketActionController''||'''Since'''||[wiki:TracDev/ApiChanges/0.11#ITicketActionController 0.11]|| |
| 4 | ||'''Module'''||''trac.ticket.api''||'''Source'''||[source:trunk/trac/ticket/api.py#/ITicketActionController api.py]|| |
| 5 | |
| 6 | The ''ITicketActionController'' allows components to add their own actions and operations to the ticket workflow. |
| 7 | |
| 8 | == Purpose == |
| 9 | TracWorkflow provides a configurable workflow for the ticket system. |
| 10 | |
| 11 | The main purpose for this interface is to allow plugins to implement new actions and operations for the workflow. |
| 12 | |
| 13 | == Usage == |
| 14 | |
| 15 | Implementing the interface follows the standard guidelines found in [wiki:TracDev/ComponentArchitecture] and of course [wiki:TracDev/PluginDevelopment]. |
| 16 | |
| 17 | Implementations have to be added to the the `workflow` option in the `[ticket]` section in [TracIni#ticket-section TracIni]. |
| 18 | |
| 19 | Trac automatically calls the following methods to let users perform actions on tickets: |
| 20 | |
| 21 | * `get_ticket_actions` returns possible actions. |
| 22 | * `get_all_status` returns possible values for the ticket ''status'' field. |
| 23 | * `render_ticket_action_control` renders an HTML UI control for selecting a particular action. |
| 24 | * `get_ticket_changes` returns the ticket field changes a particular action would make. |
| 25 | * `apply_action_side_effects` performs additional side effects. |
| 26 | |
| 27 | == Examples == |
| 28 | |
| 29 | * [source:trunk/sample-plugins/workflow/CodeReview.py CodeReview sample plugin] |
| 30 | * [source:trunk/sample-plugins/workflow/DeleteTicket.py DeleteTicket sample plugin] |
| 31 | * [source:trunk/sample-plugins/workflow/MilestoneOperation.py MilestoneOperation sample plugin] |
| 32 | * [source:trunk/sample-plugins/workflow/StatusFixer.py StatusFixer sample plugin] |
| 33 | * [source:trunk/sample-plugins/workflow/VoteOperation.py VoteOperation sample plugin] |
| 34 | |
| 35 | == Available Implementations == |
| 36 | |
| 37 | * `trac.ticket.default_workflow.ConfigurableTicketWorkflow`: Provides the default configurable workflow and operations. |
| 38 | |
| 39 | * th:AdvancedTicketWorkflowPlugin: Provides various experimental operations |
| 40 | |
| 41 | == Additional Information and References == |
| 42 | |
| 43 | * [apiref:trac.ticket.api.ITicketActionController-class epydoc] |
| 44 | * [apidoc:api/trac_ticket_api#trac.ticket.api.ITicketActionController API Reference] |
| 45 | * TracWorkflow |
| 46 | * TracIdeas/TracWorkflow |
| 47 | * The [wiki:WikiMacros#Workflow-macro Workflow macro] can visualize workflow configurations. |
| 48 | |
| 49 | === API History |
| 50 | |
| 51 | * [wiki:TracDev/ApiChanges/0.11#ITicketActionController 0.11] introduced the interface |