35 """ |
35 """ |
36 |
36 |
37 |
37 |
38 class IWorkflowable(Interface): |
38 class IWorkflowable(Interface): |
39 """interface for entities dealing with a specific workflow""" |
39 """interface for entities dealing with a specific workflow""" |
|
40 # XXX to be completed, see cw.entities.wfobjs.WorkflowableMixIn |
40 |
41 |
41 @property |
42 @property |
42 def state(self): |
43 def state(self): |
43 """return current state""" |
44 """return current state name""" |
44 |
45 |
45 def change_state(self, stateeid, trcomment=None, trcommentformat=None): |
46 def change_state(self, stateeid, trcomment=None, trcommentformat=None): |
46 """change the entity's state according to a state defined in given |
47 """change the entity's state to the state of the given name in entity's |
47 parameters |
48 workflow |
48 """ |
|
49 |
|
50 def can_pass_transition(self, trname): |
|
51 """return true if the current user can pass the transition with the |
|
52 given name |
|
53 """ |
49 """ |
54 |
50 |
55 def latest_trinfo(self): |
51 def latest_trinfo(self): |
56 """return the latest transition information for this entity |
52 """return the latest transition information for this entity |
57 """ |
53 """ |
|
54 |
58 |
55 |
59 class IProgress(Interface): |
56 class IProgress(Interface): |
60 """something that has a cost, a state and a progression |
57 """something that has a cost, a state and a progression |
61 |
58 |
62 Take a look at cubicweb.common.mixins.ProgressMixIn for some |
59 Take a look at cubicweb.common.mixins.ProgressMixIn for some |