schemas/workflow.py
branch3.5
changeset 2943 77622caef9bd
parent 2939 a613cc003ab7
child 2950 643570a7770f
equal deleted inserted replaced
2942:77ebdbe93cf8 2943:77622caef9bd
    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')])
    28 
    28 
    29     default_workflow_of = SubjectRelation('CWEType', cardinality='*?',
       
    30                                           description=_('which entity types use this workflow by default'),
       
    31                                           constraints=[RQLConstraint('O final FALSE')])
       
    32 
       
    33     initial_state = SubjectRelation('State', cardinality='?*',
    29     initial_state = SubjectRelation('State', cardinality='?*',
    34                                    # S initial_state O, O state_of S
    30                                    # S initial_state O, O state_of S
    35                                    constraints=[RQLConstraint('O state_of S')],
    31                                    constraints=[RQLConstraint('O state_of S')],
    36                                    description=_('initial state for this workflow'))
    32                                    description=_('initial state for this workflow'))
       
    33 
       
    34 
       
    35 class default_workflow(RelationType):
       
    36     """default workflow for this entity types"""
       
    37     permissions = META_RTYPE_PERMS
       
    38 
       
    39     subject = 'CWEType'
       
    40     object = 'Workflow'
       
    41     cardinality = '?*'
       
    42     constraints = [RQLConstraint('S final FALSE, O workflow_of S')]
    37 
    43 
    38 
    44 
    39 class State(EntityType):
    45 class State(EntityType):
    40     """used to associate simple states to an entity type and/or to define
    46     """used to associate simple states to an entity type and/or to define
    41     workflows
    47     workflows