schemas/workflow.py
branchstable
changeset 4805 2d0aa2b7da02
parent 4719 aaed3f813ef8
child 5421 8167de96c523
equal deleted inserted replaced
4801:d3ea940e2b0c 4805:2d0aa2b7da02
    17 class Workflow(EntityType):
    17 class Workflow(EntityType):
    18     __permissions__ = META_ETYPE_PERMS
    18     __permissions__ = META_ETYPE_PERMS
    19 
    19 
    20     name = String(required=True, indexed=True, internationalizable=True,
    20     name = String(required=True, indexed=True, internationalizable=True,
    21                   maxsize=256)
    21                   maxsize=256)
    22     description = RichString(fulltextindexed=True, default_format='text/rest',
    22     description = RichString(default_format='text/rest',
    23                              description=_('semantic description of this workflow'))
    23                              description=_('semantic description of this workflow'))
    24 
    24 
    25     workflow_of = SubjectRelation('CWEType', cardinality='+*',
    25     workflow_of = SubjectRelation('CWEType', cardinality='+*',
    26                                   description=_('entity types which may use this workflow'),
    26                                   description=_('entity types which may use this workflow'),
    27                                   constraints=[RQLConstraint('O final FALSE')])
    27                                   constraints=[RQLConstraint('O final FALSE')])
    51 
    51 
    52     name = String(required=True, indexed=True, internationalizable=True,
    52     name = String(required=True, indexed=True, internationalizable=True,
    53                   maxsize=256,
    53                   maxsize=256,
    54                   constraints=[RQLUniqueConstraint('S name N, S state_of WF, Y state_of WF, Y name N', 'Y',
    54                   constraints=[RQLUniqueConstraint('S name N, S state_of WF, Y state_of WF, Y name N', 'Y',
    55                                                    _('workflow already have a state of that name'))])
    55                                                    _('workflow already have a state of that name'))])
    56     description = RichString(fulltextindexed=True, default_format='text/rest',
    56     description = RichString(default_format='text/rest',
    57                              description=_('semantic description of this state'))
    57                              description=_('semantic description of this state'))
    58 
    58 
    59     # XXX should be on BaseTransition w/ AND/OR selectors when we will
    59     # XXX should be on BaseTransition w/ AND/OR selectors when we will
    60     # implements #345274
    60     # implements #345274
    61     allowed_transition = SubjectRelation('BaseTransition', cardinality='**',
    61     allowed_transition = SubjectRelation('BaseTransition', cardinality='**',
    75     name = String(required=True, indexed=True, internationalizable=True,
    75     name = String(required=True, indexed=True, internationalizable=True,
    76                   maxsize=256,
    76                   maxsize=256,
    77                   constraints=[RQLUniqueConstraint('S name N, S transition_of WF, Y transition_of WF, Y name N', 'Y',
    77                   constraints=[RQLUniqueConstraint('S name N, S transition_of WF, Y transition_of WF, Y name N', 'Y',
    78                                                    _('workflow already have a transition of that name'))])
    78                                                    _('workflow already have a transition of that name'))])
    79     type = String(vocabulary=(_('normal'), _('auto')), default='normal')
    79     type = String(vocabulary=(_('normal'), _('auto')), default='normal')
    80     description = RichString(fulltextindexed=True,
    80     description = RichString(description=_('semantic description of this transition'))
    81                          description=_('semantic description of this transition'))
       
    82     condition = SubjectRelation('RQLExpression', cardinality='*?', composite='subject',
    81     condition = SubjectRelation('RQLExpression', cardinality='*?', composite='subject',
    83                                 description=_('a RQL expression which should return some results, '
    82                                 description=_('a RQL expression which should return some results, '
    84                                               'else the transition won\'t be available. '
    83                                               'else the transition won\'t be available. '
    85                                               'This query may use X and U variables '
    84                                               'This query may use X and U variables '
    86                                               'that will respectivly represents '
    85                                               'that will respectivly represents '