我在文件夹草稿上创建了一个简单的工作流程,这样如果上传了新文档,用户将收到有关它的通知。如果文件获得批准,它将被移至“待批准”。由于没有截止日期功能,并且任务没有出现在用户的网站上,我尝试在文档本身上创建高级工作流程,并再次指派同一用户进行审核。但是,当用户通过任务菜单批准,并且受让人将任务设置为“已完成”时,文档不会移动到“待批准”文件夹。
我想要做的是让新文档添加到文件夹时触发高级工作流程,而不是手动将其分配给特定文档启动。触发工作流时,任务通知将发送给具有截止日期的用户(审阅者)。
使这项工作的唯一方法是构建自定义工作流程吗?如果是这样,我可以有一个例子,我应该编辑哪个文件? 提前谢谢!
答案 0 :(得分:0)
如果您可以重新说明您的问题,可能会更清楚。 你是什么意思
如果文件获得批准,则会将其移至“待批准”。
以下是高级露天开发人员指南(在我个人看来)的高级工作流程之一。这提供了创建自定义工作流程的分步指南
您还可以找到代码段来移动和替换露天“行动”中的文件Here
完整班级代码Here
仅“移动”的核心代码是:
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef) {
// get the replaces associations for this node
List<AssociationRef> assocRefs = nodeService.getTargetAssocs(actionedUponNodeRef, ((QNamePattern) QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "replaces")) );
// if there are none, return
if (assocRefs.isEmpty()) {
// no work to do, return
return;
} else {
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_FOLDER);
for (AssociationRef assocNode : assocRefs) {
// create a noderef for the replaces association
NodeRef targetNodeRef = assocNode.getTargetRef();
// if the node exists
if (this.nodeService.exists(targetNodeRef) == true) {
try {
fileFolderService.move(targetNodeRef, destinationParent, null);
} catch (FileNotFoundException e) {
// Do nothing
}
}
} // next assocNode
} // end if isEmpty
}
希望这会有所帮助