以下是我的流程:-
class APLWorkflow(Flow):
start = (
flow.StartFunction(function1)
.Next(this.request_quotes)
)
request_quotes = (
flow.Handler(function2)
.Next(this.move_package)
)
move_package = (
flow.Handler(function3)
.Next(this.shipment_create)
)
shipment_create = (
flow.Function(function4)
.Next(this.end)
)
end = flow.End()
以下是我的util函数:-
def function1():
return 1
def function2():
return 2
def function3():
return 3
def function4():
return 4
问题是当我开始流程时,它运行得很好。但是,返回的响应是起始节点的响应,而不是最后执行的节点。
以下是我的代码:-
activation.prepare()
response = APLWorkFLow.start.run(**some_kwargs)
activation.done() # stops the flow at `move_package`.
print(response) # prints 1, not 3.
如何在此处理程序(move_package
)中返回最后执行的节点的响应?