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():
|
def workItemStates():
|
||||||
return StatesDefinition('workItemStates',
|
return StatesDefinition('workItemStates',
|
||||||
State('new', 'new',
|
State('new', 'new',
|
||||||
('plan', 'accept', 'start', 'stop', 'finish', 'modify', 'delegate'),
|
('plan', 'accept', 'start', 'work', 'finish', 'modify', 'delegate'),
|
||||||
color='red'),
|
color='red'),
|
||||||
State('planned', 'planned',
|
State('planned', 'planned',
|
||||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||||
color='red'),
|
color='red'),
|
||||||
State('accepted', 'accepted',
|
State('accepted', 'accepted',
|
||||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||||
color='yellow'),
|
color='yellow'),
|
||||||
State('running', 'running',
|
State('running', 'running',
|
||||||
('stop', 'finish', 'cancel', 'modify'),
|
('work', 'finish', 'cancel', 'modify'),
|
||||||
color='orange'),
|
color='orange'),
|
||||||
State('stopped', 'stopped',
|
State('done', 'done',
|
||||||
('plan', 'accept', 'start', 'stop', 'finish', 'cancel', 'modify'),
|
('plan', 'accept', 'start', 'work', 'finish', 'cancel', 'modify'),
|
||||||
color='orange'),
|
color='orange'),
|
||||||
State('finished', 'finished',
|
State('finished', 'finished',
|
||||||
('plan', 'accept', 'start', 'stop', 'finish', 'modify', 'close'),
|
('plan', 'accept', 'start', 'work', 'finish', 'modify', 'close'),
|
||||||
color='green'),
|
color='green'),
|
||||||
State('cancelled', 'cancelled',
|
State('cancelled', 'cancelled',
|
||||||
('plan', 'accept', 'start', 'stop', 'modify', 'close'),
|
('plan', 'accept', 'start', 'work', 'modify', 'close'),
|
||||||
color='grey'),
|
color='grey'),
|
||||||
State('closed', 'closed', (), color='lightblue'),
|
State('closed', 'closed', (), color='lightblue'),
|
||||||
State('replaced', 'replaced', (), color='grey'),
|
State('replaced', 'replaced', (), color='grey'),
|
||||||
Transition('plan', 'plan', 'planned'),
|
Transition('plan', 'plan', 'planned'),
|
||||||
Transition('accept', 'accept', 'accepted'),
|
Transition('accept', 'accept', 'accepted'),
|
||||||
Transition('start', 'start working', 'running'),
|
Transition('start', 'start working', 'running'),
|
||||||
Transition('stop', 'work/stop', 'stopped'),
|
Transition('work', 'work', 'done'),
|
||||||
Transition('finish', 'finish', 'finished'),
|
Transition('finish', 'finish', 'finished'),
|
||||||
Transition('cancel', 'cancel', 'cancelled'),
|
Transition('cancel', 'cancel', 'cancelled'),
|
||||||
Transition('modify', 'modify', 'new'),
|
Transition('modify', 'modify', 'new'),
|
||||||
|
@ -196,7 +196,7 @@ class WorkItem(Stateful, Track):
|
||||||
if v is _not_found:
|
if v is _not_found:
|
||||||
if action == 'start' and k in ('end',):
|
if action == 'start' and k in ('end',):
|
||||||
continue
|
continue
|
||||||
if action in ('stop', 'finish') and k in ('duration', 'effort',):
|
if action in ('work', 'finish') and k in ('duration', 'effort',):
|
||||||
continue
|
continue
|
||||||
v = self.data.get(k)
|
v = self.data.get(k)
|
||||||
if v is not None:
|
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
|
continue work later, so he executes a ``stop`` action. The work item marked
|
||||||
as "running" will be replaced by a new one.
|
as "running" will be replaced by a new one.
|
||||||
|
|
||||||
>>> wi04 = wi03.doAction('stop', 'jim', end=1229958300)
|
>>> wi04 = wi03.doAction('work', 'jim', end=1229958300)
|
||||||
|
|
||||||
>>> wi03
|
>>> wi03
|
||||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'replaced']:
|
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'replaced']:
|
||||||
{'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}>
|
{'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}>
|
||||||
>>> wi04
|
>>> 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'}>
|
{'start': 1229958000, 'created': ..., 'end': 1229958300, 'creator': 'jim'}>
|
||||||
|
|
||||||
After another hour Jim works again on the task; he now finishes it within
|
After another hour Jim works again on the task; he now finishes it within
|
||||||
|
|
Loading…
Add table
Reference in a new issue