Java 露天-获得附着物的方法
我试过这个Java 露天-获得附着物的方法,java,rest,alfresco,activiti,Java,Rest,Alfresco,Activiti,我试过这个 @凌驾 public void notify(DelegateExecution arg0)引发异常{ 接 taskService = arg0.getEngineServices().getTaskService(); String id = arg0.getProcessInstanceId(); List <Attachment> attach = taskService.getProcessInstanceAttachments(id); taskService
@凌驾
public void notify(DelegateExecution arg0)引发异常{
接
taskService = arg0.getEngineServices().getTaskService();
String id = arg0.getProcessInstanceId();
List <Attachment> attach = taskService.getProcessInstanceAttachments(id);
taskService=arg0.getEngineServices().getTaskService();
字符串id=arg0.getProcessInstanceId();
List attach=taskService.getProcessInstanceAttachments(id);
但是我没有得到任何附件。Asattach.size()是0。
在这方面需要帮助
或者我应该尝试alfresco RESTful api来获取附件下面是相同的代码
ActivitiScriptNode scriptNode = (ActivitiScriptNode) arg0
.getVariable(WorkflowNotificationUtils.PROP_PACKAGE);
NodeRef workflowPackage = scriptNode.getNodeRef();
List<ChildAssociationRef> childAssociationRefList = nodeService.getChildAssocs(workflowPackage);
for (ChildAssociationRef child : childAssociationRefList) {
System.out.println(child.getChildRef());
}
ActivitiScriptNode脚本节点=(ActivitiScriptNode)arg0
.getVariable(WorkflowNotificationUtils.PROP_包);
NodeRef workflowPackage=scriptNode.getNodeRef();
List childAssociationRefList=nodeService.getChildAssocs(workflowPackage);
for(ChildAssociationRef子项:childAssociationRefList){
System.out.println(child.getChildRef());
}
其中child.getChildRef()表示文档的节点引用。下面是相同的代码
ActivitiScriptNode scriptNode = (ActivitiScriptNode) arg0
.getVariable(WorkflowNotificationUtils.PROP_PACKAGE);
NodeRef workflowPackage = scriptNode.getNodeRef();
List<ChildAssociationRef> childAssociationRefList = nodeService.getChildAssocs(workflowPackage);
for (ChildAssociationRef child : childAssociationRefList) {
System.out.println(child.getChildRef());
}
ActivitiScriptNode脚本节点=(ActivitiScriptNode)arg0
.getVariable(WorkflowNotificationUtils.PROP_包);
NodeRef workflowPackage=scriptNode.getNodeRef();
List childAssociationRefList=nodeService.getChildAssocs(workflowPackage);
for(ChildAssociationRef子项:childAssociationRefList){
System.out.println(child.getChildRef());
}
其中child.getChildRef()表示文档的节点引用。
您使用的是Activiti的社区版还是企业版?
我这样问是因为企业版(和V6社区版)使用不同的机制来存储附件,因此您可能会看到您看到的行为
如果使用Enterprise Edition,则需要使用平台contentService而不是taskService来检索附件
您将使用contentService.GetAllContentFortTask(taskId)
希望这有帮助,
格雷格康康
您使用的是Activiti的社区版还是企业版?
我这样问是因为企业版(和V6社区版)使用不同的机制来存储附件,因此您可能会看到您看到的行为
如果使用Enterprise Edition,则需要使用平台contentService而不是taskService来检索附件
您将使用contentService.GetAllContentFortTask(taskId)
希望这有帮助,
Greg我的是企业版。但是我没有听你的。
ApplicationContext ctx=ApplicationContextHelper.getApplicationContext();ServiceRegistry ServiceRegistry=(ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE\u REGISTRY);ContentService ContentService=ServiceRegistry.getContentService()
现在如何从这里获取附件。谢谢。我的是企业版。但是我没有听清楚。ApplicationContext ctx=ApplicationContextHelper.getApplicationContext();ServiceRegistry ServiceRegistry=(ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE\u REGISTRY);ContentService ContentService=serviceRegistry.getContentService();
现在如何从这里获取附件。谢谢