Exemple #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();
  }
Exemple #2
0
  /**
   * Inicializa los valores del formulario.
   *
   * @throws ISPACException si ocurre algún error.
   */
  public void initiate() throws ISPACException {

    // Obtenermos el procedimiento asociado
    int subPcdId = getItem().getInt("ID_SUBPROCESO");
    if (subPcdId > 0) {
      IItem item = mContext.getAPI().getProcedure(subPcdId);
      ((CompositeItem) mitem).addItem(item, "SPAC_P_PROCEDIMIENTOS:");
    }

    super.initiate();

    if (getString("ID") == null) {
      setProperty("AUTOR", mContext.getUser().getName());
      setProperty("FCREACION", DateUtil.getToday());
    }
    if (getItem().get("ID") != null) {
      // Comprobar si tiene tipos de documentos asociados

      IInvesflowAPI invesFlowAPI = mContext.getAPI();
      ICatalogAPI catalogAPI = invesFlowAPI.getCatalogAPI();
      if (catalogAPI.countTaskTpDoc(getItem().get("ID").toString()) > 0) {
        setProperty("EXISTE_TIPOS_DOCS_ASOCIADOS", "1");
      } else {
        setProperty("EXISTE_TIPOS_DOCS_ASOCIADOS", "");
      }
    } else {
      setProperty("EXISTE_TIPOS_DOCS_ASOCIADOS", "");
    }
  }
Exemple #3
0
  public void initiate() throws ISPACException {

    super.initiate();

    if (getString("ID") == null) {
      setProperty("AUTOR", mContext.getUser().getName());
      setProperty("FALTA", DateUtil.getToday());
    }
  }
Exemple #4
0
 public void store() throws ISPACException {
   super.store();
 }
Exemple #5
0
 public void initiate() throws ISPACException {
   super.initiate();
 }