Пример #1
0
  public void store() throws ISPACException {

    IInvesflowAPI invesFlowAPI = mContext.getAPI();
    ICatalogAPI catalogAPI = invesFlowAPI.getCatalogAPI();

    if (getString("ORDEN") == null) {

      // Bloqueo de las fases para obtener el último orden
      // IItemCollection itemcol = catalogAPI.queryCTEntitiesForUpdate(ICatalogAPI.ENTITY_CT_STAGE,
      // " ORDER BY ORDEN DESC ");
      IItemCollection itemcol =
          catalogAPI.queryCTEntities(ICatalogAPI.ENTITY_CT_STAGE, " ORDER BY ORDEN DESC ");

      int nextOrden = 1;
      if (itemcol != null) {

        for (Iterator iter = itemcol.iterator(); iter.hasNext(); ) {

          IItem element = (IItem) iter.next();
          String orden = element.getString("ORDEN");
          if (orden != null) {

            nextOrden = Integer.parseInt(element.getString("ORDEN")) + 1;
            break;
          }
        }
      }

      setProperty("ORDEN", new Integer(nextOrden));
    }

    super.store();
  }
Пример #2
0
 public void store() throws ISPACException {
   super.store();
 }