+ #
+ # scale = [stepx, stepy, posx, posy ]
+ #
+ def graph_get(self, cr, uid, id, scale, context={}):
+ nodes= []
+ transitions = []
+ start = []
+ tres = []
+ workflow = self.browse(cr, uid, id, context)
+ for a in workflow.activities:
+ nodes.append((a.id,a.name))
+ if a.flow_start:
+ start.append((a.id,a.name))
+ for t in a.out_transitions:
+ transitions.append( ((a.id,a.name), (t.act_to.id,t.act_to.name)) )
+ tres.append((a.id,t.act_to.id))
+ g = graph(nodes, transitions)
+ g.process(start)
+ g.scale(*scale)
+ result = g.result_get()
+ results = {}
+ for r in result.items():
+ r[1]['name'] = r[0][1]
+ results[str(r[0][0])] = r[1]
+ return {'node': results, 'transition': tres}
+