You call the nextElement() three times. When the first time you call the nextElement() method in the line of "System.out.println", it gets the first element. When you call the second time in the line "epmDoc = ", it will get the second element in the query result. Assuming you only have one describing document, you never get the one to pass to the epmDoc object.
建议如下修改:
QueryResult epmQr = wt.part.WTPartHelper.service.getDescribedByDocuments(obj);
wt.epm.EPMDocument epmDoc = null;
while (epmQr.hasMoreElements()) {
try {
Object temp = empQr.nextElement();
System.out.println("文档类型:"+temp.getClass()) ;
if(temp instanceof wt.epm.EPMDocument)
{
wt.epm.EPMDocument epmDoc = (wt.epm.EPMDocument) temp;
System.out.println("==EPM=" + epmDoc.getName());
}
} catch (Exception ex1) {
ex1.printStackTrace();
}
}
EPMDocument文档信息的获取
最新推荐文章于 2024-01-09 08:25:41 发布