109 requiredgroups=(), conditions=(), **kwargs): |
109 requiredgroups=(), conditions=(), **kwargs): |
110 tr = self.req.create_entity(trtype, name=unicode(name), **kwargs) |
110 tr = self.req.create_entity(trtype, name=unicode(name), **kwargs) |
111 self.req.execute('SET T transition_of WF ' |
111 self.req.execute('SET T transition_of WF ' |
112 'WHERE T eid %(t)s, WF eid %(wf)s', |
112 'WHERE T eid %(t)s, WF eid %(wf)s', |
113 {'t': tr.eid, 'wf': self.eid}, ('t', 'wf')) |
113 {'t': tr.eid, 'wf': self.eid}, ('t', 'wf')) |
|
114 assert fromstates, fromstates |
|
115 if not isinstance(fromstates, (tuple, list)): |
|
116 fromstates = (fromstates,) |
114 for state in fromstates: |
117 for state in fromstates: |
115 if hasattr(state, 'eid'): |
118 if hasattr(state, 'eid'): |
116 state = state.eid |
119 state = state.eid |
117 self.req.execute('SET S allowed_transition T ' |
120 self.req.execute('SET S allowed_transition T ' |
118 'WHERE S eid %(s)s, T eid %(t)s', |
121 'WHERE S eid %(s)s, T eid %(t)s', |