我想完全通过代码运行我的过程。我已经设法启动了一个进程,但是我无法运行该进程的下一部分。我尝试使用“flow.Function”并调用我想要的函数,但我没有说
'Function {} should be called with task instance', 'execute'"
并且关于这个主题的文档不是很清楚。
流.py
@flow.flow_start_func
def create_flow(activation, campos_proceso, **kwargs):
activation.process.asignador = campos_proceso['asignador']
activation.process.ejecutor = campos_proceso['ejecutor']
activation.process.tipo_de_flujo = campos_proceso['tipo_de_flujo']
activation.process.estado_del_entregable = campos_proceso[
'estado_del_entregable']
activation.process.save()
activation.prepare()
activation.done()
return activation
@flow.flow_func
def exec_flow(activation, process_fields, **kwargs):
activation.process.revisor = process_fields['revisor']
activation.process.save()
activation.prepare()
activation.done()
return activation
@frontend.register
class Delivery_flow(Flow):
process_class = DeliveryProcess
start = flow.StartFunction(create_flow).Next(this.execute)
execute = flow.Function(exec_flow).Next(this.end)
end = flow.End()
视图.py
def Execute(request): #campos_ejecucion, request):
campos_ejecucion = {
'ejecutor':request.user,
'revisor':request.user,
'observaciones_ejecutor':'Este es un puente magico',
'url_ejecucion':'https://www.youtube.com/watch?v=G-yNGb0Q91Y',
}
campos_proceso = {
'revisor':campos_ejecucion['revisor']
}
flows.Delivery_flow.execute.run()
Entregable.objects.crear_entregable()
return render(request, "Flujo/landing.html")