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))
RequestExternalInternal
module-attribute
¶
RequestExternalInternal = Workflow(_('Request external then internal review'), 'single_ext_int', **phase_data(SingleStageExtIntDefinition))
ConceptProposal
module-attribute
¶
ConceptProposal = Workflow(_('Concept & Proposal'), 'double', **phase_data(DoubleStageDefinition))
WORKFLOWS
module-attribute
¶
WORKFLOWS = {Request.admin_name: Request, RequestSameTime.admin_name: RequestSameTime, RequestExternal.admin_name: RequestExternal, RequestCommunity.admin_name: RequestCommunity, RequestExternalInternal.admin_name: RequestExternalInternal, ConceptProposal.admin_name: ConceptProposal}
PHASES
module-attribute
¶
PHASES = list(itertools.chain.from_iterable(workflow.items() for workflow in WORKFLOWS.values()))
STATUS_SLUGS
module-attribute
¶
STATUS_SLUGS = {value.display_name: value.display_slug for _, value in PHASES}
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.