Esempio n. 1
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", "");
    }
  }