专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > JBoss

求大侠帮忙,jbpm查找所有可选路径的奇怪有关问题

发布时间:2010-06-14 17:01:49 文章来源:www.iduyao.cn 采编人员:星星草
求大侠帮忙,jbpm查找所有可选路径的奇怪问题
在jbpm中部署了流程,并创建了流程实例和公文绑定一起,为什么使用instance.getRootToken().getName();得到的是null,而使用instance.getProcessDefinition().getStartState().getName();可以得到“开始”节点。我的公文是刚创建并绑定的,还没有提交。就是想在提交的时候取得下一节点,当是为什么instance.getRootToken().getName()就取不到值呢?下面是我的完整代码,请赐教。谢谢
Action代码

public class DocumentAction extends BaseAction<Document> {

/**
 * 
 */
private static final long serialVersionUID = 1L;
private Long workflowId;

/**
 * 公文内容,一般是上传Doc文档
 */
private String content;

/**
 * 公文描述
 */
private String description;

/**
 * 标题
 */
private String title;
/**
 * 审批内容
 */
private String comment;
private String ids;

/**
 * 下一步流程名称
 */
private String transitionName;
private DocumentManager documentManager;
private WorkflowManager workflowManager;

public List myDocuments() throws Exception {
return documentManager.findMyDocuments(currentuser().getId());
}

/**
 * 已审核公文列表
 * 
 * @throws Exception
 */
public List approvedList() throws Exception {
return documentManager.findApprovedDocuments(currentuser().getId());
}

/**
 * 待审核公文列表
 * 
 * @throws Exception
 */
public List approvingList() throws Exception {
return documentManager.findApprovingDocuments(currentuser().getId());
}

/**
 * 审批历史
 * 
 * @throws Exception
 */
public List approvedHistory() throws Exception {
return documentManager.findApproveInfos(this.entity.getId());
}

/**
 * 添加审批信息
 * 
 * @throws Exception
 */
public void approve() throws Exception {
Long approverId = currentuser().getId();
Long documentId = this.entity.getId();

ApproveInfo approveInfo = new ApproveInfo();
approveInfo.setApproveTime(new Date());
approveInfo.setComment(this.comment);
documentManager.addApproveInfo(approveInfo, documentId, approverId);
}

public void add() throws Exception {
Document doc = new Document();
doc.setContent(content);
doc.setCreateTime(new Date());
doc.setDescription(description);
doc.setTitle(title);
doc.setStatus(Document.STATUS_NEW);
//
this.entity.setId(documentManager.addDocument(doc, this.workflowId,
currentuser().getId()));
ServletActionContext.getResponse().getWriter().print(
"{success:true,id:" + entity.getId() + "}");
}

// 删除公文,可批量删除
public void del() throws Exception {
for (String str : ids.split(",")) {
try {
long docId = Long.parseLong(str.trim());
documentManager.delDocument(docId);
} catch (Exception e) {
continue;
}
}
ServletActionContext.getResponse().getWriter().print(
"{success:true}");
}

/**
 * 添加公文时,列出所有流程
 * 
 * @throws Exception
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: