Exemplo n.º 1
0
  public void executeTask(String sTaskClass) {

    m_appview.waitCursorBegin();

    if (m_appuser.hasPermission(sTaskClass)) {
      try {
        ProcessAction myProcess = (ProcessAction) m_appview.getBean(sTaskClass);

        // execute the proces
        try {
          MessageInf m = myProcess.execute();
          if (m != null) {
            // si devuelve un mensaje, lo muestro
            JMessageDialog.showMessage(JPrincipalApp.this, m);
          }
        } catch (BasicException eb) {
          // Si se produce un error lo muestro.
          JMessageDialog.showMessage(JPrincipalApp.this, new MessageInf(eb));
        }
      } catch (BeanFactoryException e) {
        JMessageDialog.showMessage(
            JPrincipalApp.this,
            new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("Label.LoadError"), e));
      }
    } else {
      // No hay permisos para ejecutar la accion...
      JMessageDialog.showMessage(
          JPrincipalApp.this,
          new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notpermissions")));
    }
    m_appview.waitCursorEnd();
  }