public IStage getStage(DbCnt cnt, int stagePcdId) throws ISPACException { String sql = "WHERE ID_EXP = " + getInt(IDKEY) + " AND ID_FASE = " + stagePcdId; CollectionDAO objlist = new CollectionDAO(TXFaseDAO.class); objlist.query(cnt, sql); if (objlist.next()) return (IStage) objlist.value(); return null; }
public CollectionDAO getSyncnodes(DbCnt cnt) throws ISPACException { String sql = "WHERE ID_EXP = " + getInt(IDKEY); CollectionDAO objlist = new CollectionDAO(TXSincNodoDAO.class); objlist.query(cnt, sql); return objlist; }
public static IItemCollection getProcessBPM(DbCnt cnt, String idProcessBPM, ClientContext ctx) throws ISPACException { Object[] argsarr = new Object[1]; argsarr[0] = ctx; String sql = "WHERE ID_PROCESO_BPM = '" + idProcessBPM + "'"; CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr); objlist.query(cnt, sql); return objlist.disconnect(); }
private static IItemCollection getProcesses( DbCnt cnt, int idProcedimiento, ClientContext ctx, int type) throws ISPACException { Object[] argsarr = new Object[1]; argsarr[0] = ctx; String sql = "WHERE ID_PCD = " + idProcedimiento + " AND TIPO = " + type; CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr); objlist.query(cnt, sql); return objlist.disconnect(); }
private static IItemCollection getProcess(DbCnt cnt, String numexp, ClientContext ctx, int type) throws ISPACException { Object[] argsarr = new Object[1]; argsarr[0] = ctx; String sql = "WHERE NUMEXP = '" + DBUtil.replaceQuotes(numexp) + "' AND TIPO = " + type; CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr); objlist.query(cnt, sql); return objlist.disconnect(); }
public static CollectionDAO getOutdatedProcess(DbCnt cnt) throws ISPACException { String sql = new StringBuffer("WHERE ESTADO=") .append(IProcess.OPEN) .append(" AND FECHA_LIMITE <= ") .append(DBUtil.getToDateByBD(cnt, new Date())) .append(" ORDER BY ID ASC ") .toString(); CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class); objlist.query(cnt, sql); return objlist; }
public CollectionDAO getSubprocess(DbCnt cnt, String numexp) throws ISPACException { try { String sql = "WHERE NUMEXP = '" + DBUtil.replaceQuotes(numexp) + "' AND TIPO=" + IProcess.SUBPROCESS_TYPE; ; CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class); objlist.query(cnt, sql); return objlist; } catch (ISPACException e) { throw new ISPACException("Error en TXProcesoDAO:getSubprocess()", e); } }
/* (non-Javadoc) * @see ieci.tdw.ispac.api.IWorklistAPI#getCreateProcedures() */ public IItemCollection getCreateProcedures() throws ISPACException { // Si es supervisor podra crear todos, sino le corresponderan los suyos y y los que pueden crear // los que sustituye String resp = null; DbCnt cnt = context.getConnection(); try { Responsible user = context.getUser(); SecurityMgr securityMgr = new SecurityMgr(cnt); // Comprobar si el usuario tiene asignada la función de Supervisor Total if (securityMgr.isSupervisorTotal(user.getUID())) { resp = Responsible.SUPERVISOR; } else { // los que sustituye resp = getSubstitutesRespString(); } CollectionDAO pcdset = new CollectionDAO(PProcedimientoDAO.class); /* Procedimientos en vigor */ String sqlquery = "WHERE ESTADO=" + IProcedure.PCD_STATE_CURRENT + " AND TIPO=" + IProcedure.PROCEDURE_TYPE + " AND ID IN" + " (SELECT ID_PCD FROM SPAC_SS_PERMISOS WHERE PERMISO=" + ISecurityAPI.ISPAC_RIGHTS_CREATEEXP + DBUtil.addAndInResponsibleCondition("UID_USR", resp) + ") ORDER BY NOMBRE"; pcdset.query(cnt, sqlquery); return pcdset.disconnect(); } catch (ISPACException ie) { throw new ISPACException("Error en WLWorklist:getProcs()", ie); } finally { context.releaseConnection(cnt); } }
public CollectionDAO getTasks(DbCnt cnt, int nIdStage) throws ISPACException { String sql = "WHERE ID_EXP = " + getInt(IDKEY) + " AND ID_FASE_EXP = " + nIdStage; CollectionDAO objlist = new CollectionDAO(TXTramiteDAO.class); objlist.query(cnt, sql); return objlist; }
public CollectionDAO getOpenedStages(DbCnt cnt) throws ISPACException { String sql = "WHERE ID_EXP = " + getInt(IDKEY) + " AND ESTADO = 1"; CollectionDAO objlist = new CollectionDAO(TXFaseDAO.class); objlist.query(cnt, sql); return objlist; }