1

以下是我的流程:-

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()

以下是我的实用功能:-

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.

如何在这个 Handler ( move_package) 中返回最后执行节点的响应?

4

0 回答 0