通过 Web 脚本推进 Alfresco 工作流程
我有一个 Alfresco 文档参考;我正在寻找的是一种访问附加到该文档的工作流程并通过 Javascript 完成它(或将其进行到下一个转换)的方法。
网络上几乎每个示例都展示了如何启动工作流程,如果我知道任务 ID,我可以从仪表板调用任务命令处理器 (/alfresco/command/task/end/[/transition]),但我该如何执行仅从文档参考开始的服务器端 Web 脚本有同样的事情吗?
必须有一种方法可以从文档访问工作流程并以编程方式管理它们。
I have an Alfresco document reference; what I'm looking for is a way to access workflow attached to that document and finish it (or progress it to the next transition) through Javascript.
Almost every example on the web shows how to start workflow, and from the dashlet I could call task command processor (/alfresco/command/task/end/[/transition]) if I knew the task ID, but how do I do the same thing from server-side web script starting only from the document reference?
There must be a way to access workflows from document and manage them programatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从文档 nodeRef 中,您可以像这样发出当前任务的信号:
如果您想发出默认转换的信号,您可以跳过内部循环,只需执行以下操作:
From a document nodeRef you can signal the current task like this:
If you want to signal the default transition you can skip the inner loop and just do this:
好吧,我仍然不知道如何过渡,但我发现了一些事情。
首先,我可以访问工作流程文档参与并取消它:
但是,我仍然不太确定如何进度任务。我可以到达任务并用它做一些事情:
...但我仍然不知道如何以编程方式或通过 Alfresco 到达任务 ID 或过渡 ID。
编辑:弄清楚了,transitionId实际上是工作流processdefinition XML中定义的转换名称:
此外,要从工作流中获取任务列表,您可以迭代路径(workflow.getPaths()),然后使用path.getTasks()迭代任务。
Well, I still don't know how to transition, but there are a couple of things I found out.
First, I can access workflows document participates in and cancel it:
However, I'm still not quite sure how to progress tasks. I can get to the task and do something with it:
...but I still have no idea how to get to taskId or transitionId, either programmatically or through Alfresco.
EDIT: figured it out, transitionId is actually transition name as defined in workflow processdefinition XML:
Also, to get list of tasks from the workflow you can iterate through paths (workflow.getPaths()) and then through tasks with path.getTasks().