57 allowed_transition = SubjectRelation('BaseTransition', cardinality='**', |
57 allowed_transition = SubjectRelation('BaseTransition', cardinality='**', |
58 constraints=[RQLConstraint('S state_of WF, O transition_of WF')], |
58 constraints=[RQLConstraint('S state_of WF, O transition_of WF')], |
59 description=_('allowed transitions from this state')) |
59 description=_('allowed transitions from this state')) |
60 state_of = SubjectRelation('Workflow', cardinality='1*', composite='object', |
60 state_of = SubjectRelation('Workflow', cardinality='1*', composite='object', |
61 description=_('workflow to which this state belongs'), |
61 description=_('workflow to which this state belongs'), |
62 constraints=[RQLUniqueConstraint('S name N, Y state_of O, Y name N')]) |
62 constraints=[RQLUniqueConstraint('S name N, Y state_of O, Y name N', 'Y')]) |
63 |
63 |
64 |
64 |
65 class BaseTransition(EntityType): |
65 class BaseTransition(EntityType): |
66 """abstract base class for transitions""" |
66 """abstract base class for transitions""" |
67 permissions = META_ETYPE_PERMS |
67 permissions = META_ETYPE_PERMS |
81 require_group = SubjectRelation('CWGroup', cardinality='**', |
81 require_group = SubjectRelation('CWGroup', cardinality='**', |
82 description=_('group in which a user should be to be ' |
82 description=_('group in which a user should be to be ' |
83 'allowed to pass this transition')) |
83 'allowed to pass this transition')) |
84 transition_of = SubjectRelation('Workflow', cardinality='1*', composite='object', |
84 transition_of = SubjectRelation('Workflow', cardinality='1*', composite='object', |
85 description=_('workflow to which this transition belongs'), |
85 description=_('workflow to which this transition belongs'), |
86 constraints=[RQLUniqueConstraint('S name N, Y transition_of O, Y name N')]) |
86 constraints=[RQLUniqueConstraint('S name N, Y transition_of O, Y name N', 'Y')]) |
87 |
87 |
88 |
88 |
89 class Transition(BaseTransition): |
89 class Transition(BaseTransition): |
90 """use to define a transition from one or multiple states to a destination |
90 """use to define a transition from one or multiple states to a destination |
91 states in workflow's definitions. |
91 states in workflow's definitions. |