Changeset 6294 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 7 Jun 2011, 12:11:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/workflow.py
r4920 r6294 1 """Workflow s used in the WAeUP SRP portal.1 """Workflow for applicants. 2 2 """ 3 3 import grok … … 7 7 from hurry.workflow.interfaces import IWorkflow, IWorkflowState, IWorkflowInfo 8 8 from hurry.workflow.interfaces import IWorkflowVersions 9 from waeup.sirp. interfaces import IWAeUPObject9 from waeup.sirp.applicants.interfaces import IApplicantBaseData 10 10 11 UNCHECKED = 'unchecked' 12 CHECKED = 'checked' 11 INITIALIZED = 'initialized' 12 STARTED = 'started' 13 SUBMITTED = 'submitted' 14 ADMITTED = 'admitted' 15 NOT_ADMITTED = 'not admitted' 16 CREATED = 'created' 13 17 14 18 def create_workflow(): … … 18 22 source = None, 19 23 condition = NullCondition, 20 destination = UNCHECKED)24 destination = INITIALIZED) 21 25 22 check_transition = Transition(23 transition_id = ' check',24 title = ' Check',25 source = UNCHECKED,26 destination = CHECKED)26 start_transition = Transition( 27 transition_id = 'start', 28 title = 'Start', 29 source = INITIALIZED, 30 destination = STARTED) 27 31 28 final_transition = Transition(29 transition_id = ' finalize',30 title = ' Delete',31 source = CHECKED,32 destination = None)32 submit_transition = Transition( 33 transition_id = 'submit', 34 title = 'Submit', 35 source = STARTED, 36 destination = SUBMITTED) 33 37 34 return [init_transition, check_transition, final_transition] 38 admit_transition = Transition( 39 transition_id = 'admit', 40 title = 'Admit', 41 source = SUBMITTED, 42 destination = ADMITTED) 43 44 defer_transition = Transition( 45 transition_id = 'defer', 46 title = 'Defer', 47 source = SUBMITTED, 48 destination = NOT_ADMITTED) 49 50 create_transition = Transition( 51 transition_id = 'create', 52 title = 'Create Student', 53 source = ADMITTED, 54 destination = CREATED) 55 56 #final_transition = Transition( 57 # transition_id = 'finalize', 58 # title = 'Delete', 59 # source = ADMITTED, 60 # destination = None) 61 62 return [init_transition, start_transition, submit_transition, admit_transition, 63 defer_transition, create_transition,] 35 64 36 65 37 class WAeUPWorkflow(Workflow):66 class ApplicationWorkflow(Workflow): 38 67 """A hurry.workflow Workflow with more appropriate error messages. 39 68 """ … … 55 84 56 85 57 class WorkflowNullVersions(WorkflowVersions):86 class ApplicationWorkflowNullVersions(WorkflowVersions): 58 87 """A workflow versions manager that does not handle versions. 59 88 … … 85 114 86 115 # Register global utilities for workflows and workflow versions... 87 grok.global_utility( WAeUPWorkflow, IWorkflow)88 grok.global_utility( WorkflowNullVersions, IWorkflowVersions)116 grok.global_utility(ApplicationWorkflow, IWorkflow) 117 grok.global_utility(ApplicationWorkflowNullVersions, IWorkflowVersions) 89 118 90 119 class WorkflowState(grok.Adapter, WorkflowState): 91 """An adapter to adapt WAeUPobjects to workflow states.120 """An adapter to adapt Applicant objects to workflow states. 92 121 """ 93 grok.context(I WAeUPObject)122 grok.context(IApplicantBaseData) 94 123 grok.provides(IWorkflowState) 95 124 96 125 class WorkflowInfo(grok.Adapter, WorkflowInfo): 97 """Adapter to adapt WAeUPobjects to workflow info objects.126 """Adapter to adapt Applicant objects to workflow info objects. 98 127 """ 99 grok.context(I WAeUPObject)128 grok.context(IApplicantBaseData) 100 129 grok.provides(IWorkflowInfo)
Note: See TracChangeset for help on using the changeset viewer.