work in progress: new work item lifecycle
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3135 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
8bf7ef1ea0
commit
cf93ec49d7
2 changed files with 15 additions and 5 deletions
|
@ -177,6 +177,10 @@ class WorkItem(Stateful, Track):
|
||||||
for k in self.initAttributes:
|
for k in self.initAttributes:
|
||||||
v = kw.get(k, _not_found)
|
v = kw.get(k, _not_found)
|
||||||
if v is _not_found:
|
if v is _not_found:
|
||||||
|
if action == 'start' and k in ('end',):
|
||||||
|
continue
|
||||||
|
if action in ('stop', 'finish') and k in ('duration', 'effort',):
|
||||||
|
continue
|
||||||
v = self.data.get(k)
|
v = self.data.get(k)
|
||||||
if v is not None:
|
if v is not None:
|
||||||
newData[k] = v
|
newData[k] = v
|
||||||
|
|
|
@ -98,8 +98,7 @@ but may also be specified explicitly.
|
||||||
>>> wi03 = wi02.doAction('start', start=1229958000)
|
>>> wi03 = wi02.doAction('start', start=1229958000)
|
||||||
>>> wi03
|
>>> wi03
|
||||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'running']:
|
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'running']:
|
||||||
{'duration': 700, 'start': 1229958000, 'created': ...,
|
{'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}>
|
||||||
'end': 1229956372, 'creator': 'jim'}>
|
|
||||||
|
|
||||||
Stopping and finishing work
|
Stopping and finishing work
|
||||||
---------------------------
|
---------------------------
|
||||||
|
@ -110,8 +109,15 @@ continue work later, so he executes a ``stop`` action.
|
||||||
>>> wi04 = wi03.doAction('stop', end=1229958300)
|
>>> wi04 = wi03.doAction('stop', end=1229958300)
|
||||||
>>> wi04
|
>>> wi04
|
||||||
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'stopped']:
|
<WorkItem ['001', 1, 'jim', '2008-12-22 15:00', 'stopped']:
|
||||||
{'duration': 700, 'start': 1229958000, 'created': ...,
|
{'start': 1229958000, 'created': ..., 'end': 1229958300, 'creator': 'jim'}>
|
||||||
'end': 1229958300, 'creator': 'jim'}>
|
|
||||||
|
After another hour Jim works again on the task; he now finishes it within
|
||||||
|
ten minutes and records this in one step.
|
||||||
|
|
||||||
|
>>> wi05 = wi04.doAction('finish', start=1229961600, end=1229967200)
|
||||||
|
>>> wi05
|
||||||
|
<WorkItem ['001', 1, 'jim', '2008-12-22 16:00', 'finished']:
|
||||||
|
{'start': 1229961600, 'created': ..., 'end': 1229967200, 'creator': 'jim'}>
|
||||||
|
|
||||||
Closing work
|
Closing work
|
||||||
------------
|
------------
|
||||||
|
@ -119,7 +125,7 @@ Closing work
|
||||||
Let's now check how many work items have been generated.
|
Let's now check how many work items have been generated.
|
||||||
|
|
||||||
>>> len(list(workItems))
|
>>> len(list(workItems))
|
||||||
4
|
5
|
||||||
|
|
||||||
|
|
||||||
Delegation of Work Items
|
Delegation of Work Items
|
||||||
|
|
Loading…
Add table
Reference in a new issue