Пример #1
0
  public IItemCollection getStages(int idProcedure, String resp) throws ISPACException {
    // Comprobamos si es un subprocesos

    DbCnt cnt = context.getConnection();
    List id_pcd_padres = null;
    try {
      IInvesflowAPI invesFlowAPI = context.getAPI();
      IProcedure iProcedure = invesFlowAPI.getProcedure(idProcedure);

      if (iProcedure.getInt("TIPO") == IPcdElement.TYPE_SUBPROCEDURE) {
        IItemCollection itemcol =
            invesFlowAPI
                .getCatalogAPI()
                .queryCTEntities(
                    ICatalogAPI.ENTITY_P_TASK,
                    "where id_cttramite in (select id from spac_ct_tramites where id_subproceso="
                        + idProcedure
                        + ")");
        // Obtenemos la lista de padres
        id_pcd_padres = new ArrayList();
        while (itemcol.next()) {

          id_pcd_padres.add(((IItem) itemcol.value()).get("ID_PCD"));
        }
      }
      return WLStageDAO.getStages(cnt, resp, idProcedure, id_pcd_padres).disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException("Error en WLWorklist:getStages(" + idProcedure + ")", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Пример #2
0
  public IItem getStage(String numExp) throws ISPACException {

    String resp = getRespString();
    DbCnt cnt = context.getConnection();
    try {
      IItemCollection fasesDelExpediente = WLStageDAO.getStage(cnt, resp, numExp).disconnect();
      for (Iterator itFases = fasesDelExpediente.iterator(); itFases.hasNext(); ) {
        IItem fase = (IItem) itFases.next();
        return fase;
      }
      return null;
    } catch (ISPACException ie) {
      throw new ISPACException("Error en WLWorklist:getStage(" + numExp + ")", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }