0

I have a flow with the logic as below:

class MyFlow(Flow):
    start = flow.Start(StartProcess).Next(this.if_A_B)
    if_A_B = flow.If(cond=lambda act: act.process.if_A_B). \
        Then(this.A).
        Else(this.B)
    A = flow.View(HandleA). \
        Next(this.B)
    B = flow.View(HandleB). \
        Next(this.if_A_C)
    if_A_C = flow.If(cond=lambda act: act.process.if_A_C). \
        Then(this.A). \
        Else(this.C)
    C = flow.View(HandleC). \
        Next(this.end)

I expect that in some case: task A done -> task B done -> if_A_C is True then activate a new task A_NEW -> task A_NEW done -> task B_NEW done.

But I find after task A is done and activate task B, the flow_task & process of B are empty. I try set process.if_A_B to False so that skip task A, then task B had flow_task & process. Another try is comment if_A_C and C, so task B's next is this.end, then after task A is done and activate task B, the flow_task & process are there.

I wonder does viewflow support directly jumping to previous task? Or I should cancel B then undo A to go from B back to A?

Rachel
  • 1
  • It's not clear, what do you mean by "flow_task & process of B are empty" It can't be empty due db constraints. Each flow step creates a new task entity in the database, generally there is no "previous" task, the previous instance of B has status DONE and new instance of B has status NEW. There is always a chain of a task instances in order how they was executed. Since you have a loop in your flow graph, a process instance could have multiple db records of tasks with same flow_task type – kmmbvnr Oct 02 '18 at 10:10
  • Thanks for the response. When I debug "task A DONE then activate task B NEW" step by step, I do notice flow_task & process of B are there in the middle of the execution, then I continue to finish whole execution. After that, flow_task & process of B are gone. – Rachel Oct 08 '18 at 01:43
  • Define a FLOW that one task jump backward, is django-viewflow designed to allow that? – Rachel Oct 08 '18 at 01:49

0 Answers0