rename 'stop' transition to 'work', and 'stopped' state to 'done'
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3155 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
28c88e7176
commit
51fd16c8de
2 changed files with 12 additions and 12 deletions
|
@ -42,32 +42,32 @@ _not_found = object()
|
|||
def workItemStates():
|
||||
return StatesDefinition('workItemStates',
|
||||
State('new', 'new',
|
||||
('plan', 'accept', 'start', 'stop', 'finish', 'modify', 'delegate'),
|
||||
('plan', 'accept', 'start', 'work', 'finish', 'modify', 'delegate'),
|
||||
color='red'),
|
||||
State('planned', 'planned',
|
||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
||||
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||
color='red'),
|
||||
State('accepted', 'accepted',
|
||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
||||
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||
color='yellow'),
|
||||
State('running', 'running',
|
||||
('stop', 'finish', 'cancel', 'modify'),
|
||||
('work', 'finish', 'cancel', 'modify'),
|
||||
color='orange'),
|
||||
State('stopped', 'stopped',
|
||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
||||
State('done', 'done',
|
||||
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||
color='orange'),
|
||||
State('finished', 'finished',
|
||||
('plan', 'accept', 'start', 'stop', 'finish', 'modify', 'close'),
|
||||
('plan', 'accept', 'start', 'work', 'finish', 'modify', 'close'),
|
||||
color='green'),
|
||||
State('cancelled', 'cancelled',
|
||||
('plan', 'accept', 'start', 'stop', 'modify', 'close'),
|
||||
('plan', 'accept', 'start', 'work', 'modify', 'close'),
|
||||
color='grey'),
|
||||
State('closed', 'closed', (), color='lightblue'),
|
||||
State('replaced', 'replaced', (), color='grey'),
|
||||
Transition('plan', 'plan', 'planned'),
|
||||
Transition('accept', 'accept', 'accepted'),
|
||||
Transition('start', 'start working', 'running'),
|
||||
Transition('stop', 'work/stop', 'stopped'),
|
||||
Transition('work', 'work', 'done'),
|
||||
Transition('finish', 'finish', 'finished'),
|
||||
Transition('cancel', 'cancel', 'cancelled'),
|
||||
Transition('modify', 'modify', 'new'),
|
||||
|
@ -196,7 +196,7 @@ class WorkItem(Stateful, Track):
|
|||
if v is _not_found:
|
||||
if action == 'start' and k in ('end',):
|
||||
continue
|
||||
if action in ('stop', 'finish') and k in ('duration', 'effort',):
|
||||
if action in ('work', 'finish') and k in ('duration', 'effort',):
|
||||
continue
|
||||
v = self.data.get(k)
|
||||
if v is not None:
|
||||
|
|
|
@ -107,13 +107,13 @@ After five minutes of work Jim decides to stop working; but he will
|
|||
continue work later, so he executes a ``stop`` action. The work item marked
|
||||
as "running" will be replaced by a new one.
|
||||
|
||||
>>> wi04 = wi03.doAction('stop', 'jim', end=1229958300)
|
||||
>>> wi04 = wi03.doAction('work', 'jim', end=1229958300)
|
||||
|
||||
>>> wi03
|
||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'replaced']:
|
||||
{'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}>
|
||||
>>> wi04
|
||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'stopped']:
|
||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'done']:
|
||||
{'start': 1229958000, 'created': ..., 'end': 1229958300, 'creator': 'jim'}>
|
||||
|
||||
After another hour Jim works again on the task; he now finishes it within
|
||||
|
|
Loading…
Add table
Reference in a new issue