我有一个典型的工作流,如下所示:
Start -> Notify -> Task -> End在向需要执行任务的人发送电子邮件的通知步骤中,我想包括直接转到“任务”分配页面的url,这是可能的吗?
我的问题是,在通知步骤中,我认为任务步骤还没有在数据库中创建,所以无法生成url。
更新:
感谢您的回答,发布生成分配url的代码:
def handler(self, activation):
process = activation.process
path = reverse('viewflow:connect:new_request/flow/newrequest:{}__assign'.format(activation.flow_task.name), args=[process.pk, activation.task.pk])发布于 2021-05-19 18:26:41
您可以将其添加为flow.View(...)。onCreate handler
class MyFlow(Flow):
approve = flow.View(...).OnCreate(this.on_approve_created)
def on_approve_created(self, activation):
if activation.task.owner:
send_mail(
'View task assigned to you','Here is the message.',
'from@example.com', [activation.task.owner.email]
)https://stackoverflow.com/questions/67495569
复制相似问题