判断单据是否在工作流中运行

来源:互联网 发布:导弹艇积木淘宝 编辑:程序博客网 时间:2024/04/30 14:41
 /** * 判断单据是否在工作流中 * @param ctx * @param billId * @return * @throws BOSException */public static boolean isInWf(Context ctx, String billId) throws BOSException {boolean isInWf = false;IEnactmentService service = null;if(ctx == null) {        service = EnactmentServiceFactory.createRemoteEnactService();} else {service = EnactmentServiceFactory.createEnactService(ctx);}        ProcessInstInfo processInstInfo = null;        ProcessInstInfo procInsts[] = service.getProcessInstanceByHoldedObjectId(billId);        int i = 0;        for(int n = procInsts.length; i < n; i++)            if(procInsts[i].getState().startsWith("open.running"))                processInstInfo = procInsts[i];        if(processInstInfo != null) {         isInWf = true;        }        return isInWf;}

原创粉丝点击