1

Given the following steps defined

enter image description here

And when I dig into the internal tables, especially viewflow_task_previous table, it seems the from and to are reversed?

pmas=> select * from viewflow_task_previous where from_task_id = 10248;
  id  | from_task_id | to_task_id 
------+--------------+------------
 9099 |        10248 |      10247
(1 row)

pmas=> select id, status, flow_task, status from viewflow_task where id = 10248;
  id   |  status  |                                flow_task                                |  status  
-------+----------+-------------------------------------------------------------------------+----------
 10248 | ASSIGNED | connect_it/flows.new_circuit.flow.NewCircuit.external_task_installation | ASSIGNED
(1 row)

pmas=> select id, status, flow_task, status from viewflow_task where id = 10247;
  id   | status |                                flow_task                                | status 
-------+--------+-------------------------------------------------------------------------+--------
 10247 | DONE   | connect_it/flows.new_circuit.flow.NewCircuit.external_task_provisioning | DONE
(1 row)

Could someone explain why and how this works?

James Lin
  • 25,028
  • 36
  • 133
  • 233

1 Answers1

0

viewflow_task_previous table created by models.ManyToManyField previous field of the Task model

https://github.com/viewflow/viewflow/blob/master/viewflow/models.py#L97

Yep, that gives some confusion on the SQL level

kmmbvnr
  • 5,863
  • 4
  • 35
  • 44