public void actionViewDoProccess_actionPerformed(ActionEvent e) throws Exception
{
checkSelected();
String fieldName = getQueryFieldNameBindingWf();
List valList = getSelectedFDCFieldValues(fieldName);
if(valList==null || valList.size()<1)
{
MsgBox.showInfo("请选择答疑澄清记录行!");
SysUtil.abort();
}
String id = (String)getSelectedFDCFieldValues(fieldName).get(0);
IEnactmentService service = EnactmentServiceFactory.createRemoteEnactService();
ProcessInstInfo processInstInfo = null;
ProcessInstInfo[] procInsts = service.getProcessInstanceByHoldedObjectId(id);
for (int i = 0, n = procInsts.length; i < n; i++) {
if (procInsts[i].getState().startsWith("open")) {
processInstInfo = procInsts[i];
}
}
if (processInstInfo == null) {
//如果没有运行时流程,判断是否有可以展现的流程图并展现
procInsts = service.getAllProcessInstancesByBizobjId(id);
if(procInsts== null || procInsts.length <=0)
MsgBox.showInfo(this ,EASResource.getString(FrameWorkClientUtils.strResource+ "Msg_WFHasNotInstance"));
else if(procInsts.length ==1){
showWorkflowDiagram(procInsts[0]);
}else{
UIContext uiContext = new UIContext(this);
uiContext.put("procInsts",procInsts);
String className = ProcessRunningListUI.class.getName();
IUIWindow uiWindow = UIFactory.createUIFactory(UIFactoryName.MODEL).create(className,uiContext);
uiWindow.show();
}
} else {
showWorkflowDiagram(processInstInfo);
}
}