/**
   * Execute action's workflow.
   *
   * @throws org.areasy.runtime.engine.base.AREasyException if any global error occurs. All errors
   *     comming from action's execution will become output items
   */
  public void run() throws AREasyException {
    // execute the requested action for each user
    for (int i = 0; i < getUsers().size(); i++) {
      String username = (String) getUsers().get(i);

      try {
        People person = new People();
        person.setLoginId(username);
        person.read(getServerConnection());

        if (person.exists()) {
          // check people unrestricted access flag.
          if (person.getAttributeValue(1000003975) != null) {
            person.setNullAttribute(1000003975);
            person.setIgnoreNullValues(false);

            person.update(getServerConnection());
            RuntimeLogger.info("Unrestricted access flag was removed for user '" + username + "'");
          }
        } else RuntimeLogger.error("People account wasn't found: " + person);
      } catch (Throwable th) {
        RuntimeLogger.error(
            "Error removing unrestricted access for user '" + username + "': " + th.getMessage());
        getLogger().debug("Exception", th);
      }

      // check interruption and and exit if the execution was really interrupted
      if (isInterrupted()) {
        RuntimeLogger.warn("Execution interrupted by user");
        return;
      }
    }
  }
Пример #2
0
  public void perform(DevProcessAction develop) {
    // prepare data for export
    for (int i = 0; getObjectsList() != null && i < getObjectsList().size(); i++) {
      String objname = null;
      String objtype = null;

      try {
        // read developed object
        WorksheetObject devobj = (WorksheetObject) getObjectsList().get(i);

        objname = devobj.getObjectName();
        objtype = devobj.getSignature();

        // take the corresponding action
        OverlayAction action = new OverlayAction();
        action.init(develop);

        // get the base object instance and run the action
        String objSignature = getPluralObjectTypeNameBySignature(objtype);
        ObjectWrapper wrapper = action.getObjectWrapper(objSignature);

        if (wrapper instanceof FormRelatedWrapper) {
          ((FormRelatedWrapper) wrapper).setFormName(objname);
          objname = devobj.getRelatedData();
        }

        ObjectBase object = wrapper.getInstance(objname);

        action.execute(object);
      } catch (Throwable th) {
        RuntimeLogger.error(
            "Error running overlay action for a '" + objname + "' definition: " + th.getMessage());
        getLogger().debug("Exception", th);
      }
    }

    RuntimeLogger.info("Overlay action for the specified development package has been done");
  }