Registry
hypha.apply.funds.workflows.registry
¶
This file defines classes which allow you to compose workflows based on the following structure:
Workflow -> Stage -> Phase -> Action
Current limitations: * Changing the name of a phase will mean that any object which references it cannot progress. [will be fixed when streamfield, may require intermediate fix prior to launch] * Do not reorder without looking at workflow automations steps in form_valid() in hypha/apply/funds/views.py and hypha/apply/review/views.py.
Request
module-attribute
¶
Request = Workflow('Request', 'single', **phase_data(SingleStageDefinition))
RequestSameTime
module-attribute
¶
RequestSameTime = Workflow('Request with same time review', 'single_same', **phase_data(SingleStageSameDefinition))
RequestExternal
module-attribute
¶
RequestExternal = Workflow('Request with external review', 'single_ext', **phase_data(SingleStageExternalDefinition))
RequestCommunity
module-attribute
¶
RequestCommunity = Workflow('Request with community review', 'single_com', **phase_data(SingleStageCommunityDefinition))
ConceptProposal
module-attribute
¶
ConceptProposal = Workflow('Concept & Proposal', 'double', **phase_data(DoubleStageDefinition))
WORKFLOWS
module-attribute
¶
WORKFLOWS = {admin_name: Request, admin_name: RequestSameTime, admin_name: RequestExternal, admin_name: RequestCommunity, admin_name: ConceptProposal}
active_statuses
module-attribute
¶
active_statuses = [status for (status, _) in PHASES if 'accepted' not in status and 'rejected' not in status and 'invited' not in status]
phase_data
¶
Transforms a workflow definition into a dictionary of Phase objects.
Parameters:
-
phases
(List[dict]
) –A list of dictionaries defining the workflow phases and their configurations.
Returns:
-
dict[str, Phase]
–A dictionary where keys are phase names and values are Phase objects, each initialized with: - phase name - step number (order in workflow) - additional configuration data from the phase definition
Example
Input phases = [ {'draft': {'permissions': {...}}}, {'review': {'permissions': {...}}} ]
Returns = { 'draft': Phase('draft', step=0, permissions={...}), 'review': Phase('review', step=1, permissions={...}) }
Source code in hypha/apply/funds/workflows/registry.py
get_review_active_statuses
¶
Source code in hypha/apply/funds/workflows/registry.py
get_review_statuses
¶
Source code in hypha/apply/funds/workflows/registry.py
get_ext_review_statuses
¶
get_ext_or_higher_statuses
¶
Returns a set of all the statuses for all workflow which are External Review or higher than that.