cubicweb/wfutils.py
branch3.26
changeset 12432 2fcb53ee5178
parent 11963 64ecd4d96ac7
child 12567 26744ad37953
equal deleted inserted replaced
12431:a570191d67b0 12432:2fcb53ee5178
   122 
   122 
   123     if 'initial_state' in wfdef:
   123     if 'initial_state' in wfdef:
   124         wf.cw_set(initial_state=states[wfdef['initial_state']])
   124         wf.cw_set(initial_state=states[wfdef['initial_state']])
   125 
   125 
   126     for trname, trdef in wfdef['transitions'].items():
   126     for trname, trdef in wfdef['transitions'].items():
   127         tr = (wf.transition_by_name(trname) or
   127         tr = (wf.transition_by_name(trname)
   128               cnx.create_entity('Transition', name=trname))
   128               or cnx.create_entity('Transition', name=trname))
   129         tr.cw_set(transition_of=wf)
   129         tr.cw_set(transition_of=wf)
   130         if trdef.get('tostate'):
   130         if trdef.get('tostate'):
   131             tr.cw_set(destination_state=states[trdef['tostate']])
   131             tr.cw_set(destination_state=states[trdef['tostate']])
   132         fromstates = get_tuple_or_list(trdef.get('fromstates', ()))
   132         fromstates = get_tuple_or_list(trdef.get('fromstates', ()))
   133         for stname in fromstates:
   133         for stname in fromstates: