// /////////////////////上一个节点决定下一个节点的执行,把决定对象的权限写入权限表
private void storeNextNodeAuthorization(NodeInstance nextNodeInstance) {
SessionContext us = DOGlobals.getInstance().getSessoinContext();
BOInstance formI = us.getFormInstance();
// if (nextPerformerUid == null || "".equals(nextPerformerUid.trim())) {
// nextPerformerUid = formI.getValue("doNextPerformerUid2");
// }
// if (nextPerformerUid == null || "".equals(nextPerformerUid.trim())) {
// nextPerformerUid = formI.getValue("doNextPerformerUid3");
// }
// /////////除了处理schedue_user 的情况,还要处理
// schedule_dept等的情况,又跟组织结构表绑死了,可以考虑另外的方式
// //////////////很简单 有ptNode 决定 和哪级组织结构绑定,ptnode 再增加一个字段,表示需要绑定的组织机构
if (nextNodeInstance.getAuthType() != null
&& (nextNodeInstance.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_USER || nextNodeInstance
.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_ROLE)) {
// //通过从界面上取值,上一个节点的SpecName决定下一个节点的使用者
String scheduleIds = "scheduleIds";
// if (scheduleIds == null || "".equals(scheduleIds.trim())) {
// scheduleIds = "scheduleIds";
// }
String nextPerformerUids = formI.getValue(scheduleIds);
// /一般在实际审批过程中,就是制定人,如果指定角色意义不大,因为角色范围大,完全可以采用预定义的
// //而具体的人的弹性比较大; PTNode.AUTH_TYPE_SCHEDULE_ROLE这个可以去掉
if (nextPerformerUids != null) {
if (nextPerformerUids.length() < 50) {
nextNodeInstance.setScheduleOUUid(nextPerformerUids);
}
String[] idarray = nextPerformerUids.split(",");
for (int i = 0; i < idarray.length; i++) {
String anId = idarray[i];
DOAuthorization da = new DOAuthorization();
storePersionAuth(nextNodeInstance.getObjUid(),anId);
// /针对 user 存储 存储权限表, 修改待办的 sql
//
// da.setParterUid(OrgParter.getDefaultEmployee().getObjUid());
// da.setOuUid(anId);
// da.setWhatType(DOAuthorization.WHAT_WF_NODEINSTANCE);
// da.setWhatUid(this.getObjUid());
// da.setAuthority(Boolean.TRUE);
// da.setIsInherit(Boolean.TRUE);
// try {
// DAOUtil.BUSI().store(da);
// } catch (ExedoException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
}
// WFDAO dao = new WFDAO();
try {
DAOUtil.BUSI().store(nextNodeInstance);
} catch (Exception ex) {
ex.printStackTrace();
}
}
/**
* 计划执行的人员有自定义的动作来完成,这个方法并不是由上个节点决定的
*
*
*
*
*
*/
if (nextNodeInstance.getAuthType() != null
&& (nextNodeInstance.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_CLASS)) {
DOAction doa = ActionFactory.getAction(nextNodeInstance.getNode()
.getAccessClass());
BOInstance para = new BOInstance();
para.putValue("corr_nodeinstance", nextNodeInstance);
doa.setInstance(para);
if (doa != null) {
try {
doa.excute();
} catch (ExedoException e) {