Performs the action the object was designed to do.
486445
public function run() {
		$array = ValueUtils::val($this->array);
		foreach ($array as $key => $value) {
			if ($this->key != null) {
				$this->key->setValue($key);
			}
			if ($this->value != null) {
				$this->value->setValue($value);
			}
			foreach ($this->actions as $action) {
				$action->run();
			}
		}
	}
1343931
def perform_action(
            self, action, machines, params, progress_title, success_title):
        """"""
        if len(machines) == 0:
            return 0
        with utils.Spinner() as context:
            return self._async_perform_action(
                context, action, list(machines), params,
                progress_title, success_title)
1065882
@Override
    public final void run() {
        for (; ; ) {
            final BaasHandler<?> curr = suspendableHandler.get();
            // at this stage we are in the callback thread of execution
            // we get the current handler and choose the state to reach
            if (curr == Signal.COMMITTED) {
                //the callback has already run
                // really we don't have to make any work
                return;
            }

            final BaasHandler<?> target;
            if (curr == Signal.SUSPENDED || curr == Signal.DELIVERED) {
                //if the current state is SUSPENDED the target state
                //to reach is DELIVERED
                //handlers in DELIVERED state won't change and remain the same
                //so for both the cases the target state would be
                // DELIVERED and there would be no more work to do
                target = Signal.DELIVERED;
            } else {
                // we have a real handler to execute
                // and we need to commit the execution
                target = Signal.COMMITTED;
            }

            if (suspendableHandler.compareAndSet(curr, target)) {
                //at this point the transition is completed
                //if the target we reached is COMMITTED than we have
                //to execute the callback and cleanup the dispatcher
                if (target == Signal.COMMITTED) {
                    if (curr != null) {
                        ((BaasHandler<R>) curr).handle(result);
                    }
                    finish();
                }
                return;
            }
        }
    }
799819
protected function performAction()
    {
        $data = $this->getModel()->loadFirst();

        parent::performAction();

        $this->accesslog->logChange($this->request, $this->getTitle(), $data);
    }
383614
public void performAction() throws InterruptedException {
	if (isDone()) {
	    return;
	}

	performing.set(true);

	try {
	    getAction().perform(unschedulable); // Execute action
	} catch (final InterruptedException e) {
	    cancelled.set(true);
	    throw e;
	} catch (final Exception e) { // Continue
	    logger.log(Level.WARNING, "Error performing action", e);
	    if (!isPeriodicOnException()) {
		cancelled.set(true);
	    }
	} finally {
	    performing.set(false);
	    done.set(true);
	    signalRan(); // Wake up awaiting
	}

	if (isCancelled()) {
	    return;
	}

	if (isPeriodic()) {
	    estimated.set(System.nanoTime() + getPeriod(TimeUnit.NANOSECONDS));
	    done.set(false);
	    addAsWork(); // Add to engines work queue
	}
    }
245364
protected void handleObjectPressed (final SceneObject scobj, int mx, int my)
    {
        String action = scobj.info.action;
        final ObjectActionHandler handler = ObjectActionHandler.lookup(action);

        // if there's no handler, just fire the action immediately
        if (handler == null) {
            fireObjectAction(null, scobj, new SceneObjectActionEvent(
                                 this, 0, action, 0, scobj));
            return;
        }

        // if the action's not allowed, pretend like we handled it
        if (!handler.actionAllowed(action)) {
            return;
        }

        // if there's no menu for this object, fire the action immediately
        RadialMenu menu = handler.handlePressed(scobj);
        if (menu == null) {
            fireObjectAction(handler, scobj, new SceneObjectActionEvent(
                                 this, 0, action, 0, scobj));
            return;
        }

        // make the menu surround the clicked object, but with consistent size
        Rectangle mbounds = getRadialMenuBounds(scobj);

        _activeMenu = menu;
        _activeMenu.addActionListener(new ActionListener() {
            public void actionPerformed (ActionEvent e) {
                if (e instanceof CommandEvent) {
                    fireObjectAction(handler, scobj, e);
                } else {
                    SceneObjectActionEvent event = new SceneObjectActionEvent(
                        e.getSource(), e.getID(), e.getActionCommand(),
                        e.getModifiers(), scobj);
                    fireObjectAction(handler, scobj, event);
                }
            }
        });
        _activeMenu.activate(this, mbounds, scobj);
    }
403918
def perform(action, workitem)
      @action, @workitem = action, workitem
      send(action)
      write_output('') # Triggers any remaining buffered output to be sent
      run_callbacks
    rescue MaestroDev::Plugin::PluginError => e
      write_output('') # Triggers any remaining buffered output to be sent
      set_error(e.message)
    rescue Exception => e
      write_output('') # Triggers any remaining buffered output to be sent
      lowerstack = e.backtrace.find_index(caller[0])
      stack = lowerstack ? e.backtrace[0..lowerstack - 1] : e.backtrace
      msg = "Unexpected error executing task: #{e.class} #{e} at\n" + stack.join("\n")
      Maestro.log.warn("#{msg}\nFull stack:\n" + e.backtrace.join("\n"))

      # Let user-supplied exception handler do its thing
      handle_exception(e)
      set_error(msg)
    ensure
      # Older agents expected this method to *maybe* return something
      # .. something that no longer exists, but if we return anything
      # it will be *wrong* :P
      return nil
    end
471840
private JSONObject makeActionSkeleton(Action a) {
        JSONObject o = new JSONObject();
        o.put(START_LABEL, a.getStart());
        o.put(END_LABEL, a.getEnd());
        JSONObject hooks = new JSONObject();
        for (Action.Hook k : Action.Hook.values()) {
            JSONArray arr = new JSONArray();
            for (Event e : a.getEvents(k)) {
                arr.add(toJSON(e));
            }
            hooks.put(k.toString(), arr);
        }
        o.put(HOOK_LABEL, hooks);
        return o;
    }
158025
def on_action(action):
    
    @wrapt.decorator
    @tornado.gen.coroutine
    def _execute(wrapped, instance, args, kwargs):
        return wrapped(*args, **kwargs)

    _execute.action = action
    return _execute
1044361
def run_actions
        catch_exceptions do
          @success = if block_given?
            result = yield
            actions.each {|action| results[action] = result}
            !!result
          else
            actions.compact.each {|action| !skip_actions && results[action] = object.send(action)}
            results.values.all?
          end
        end
      end
1035242
@Override
    protected void doPerform() {
        if (isSourceDocumentRoot()) {
            getActions().contextClick().perform();
        } else {
            getActions().contextClick(getFirstElement()).perform();
        }
    }
8436
function doaction(type, data) {
		if (gui.hosted) {
			gui.Action.ascendGlobal(document, type, data);
		}
	}
610772
def target(self, obj, **kwargs):
        
        check(obj)
        return obj.target_actions.public(**kwargs)
868163
void execute_cmd() {
	final WorkItem wo = new WorkItem();
	int nb_elt;
	int i;

	switch (local_cmd.cmd_code) {
	// Add a new object
	case Tango_POLL_ADD_OBJ:
	    Util.out5.println("Received a Add object command");
	    wo.dev = local_cmd.dev;
	    wo.poll_list = wo.dev.get_poll_obj_list();
	    final PollObj poll_obj = (PollObj) wo.poll_list.elementAt(local_cmd.index);
	    wo.type = poll_obj.get_type();
	    wo.update = poll_obj.get_upd();
	    wo.name = poll_obj.get_name();

	    if (wo.update != 0) {
		// Add a random delay to do not start all at same time
		now.tv_usec += new java.util.Random().nextInt(500000);
		wo.wake_up_date = now;
		insert_in_list(wo);
	    } else {
		wo.wake_up_date.tv_sec = 0;
		wo.wake_up_date.tv_usec = 0;
		ext_trig_works.add(wo);
	    }
	    break;

	// Remove an already polled object
	case Tango_POLL_REM_OBJ:
	    Util.out5.println("---> Received a Rem object command");

	    dev_to_del = local_cmd.dev;
	    name_to_del = local_cmd.name;
	    type_to_del = local_cmd.type;
	    nb_elt = works.size();
	    for (i = 0; i < nb_elt; i++) {
		final WorkItem item = (WorkItem) works.elementAt(i);
		if (item.dev == dev_to_del) {
		    if (item.type == type_to_del) {
			if (item.name.equals(name_to_del)) {
			    works.remove(i);
			    break;
			}
		    }
		}
	    }
	    break;

	// Remove all objects belonging to a device.
	// Take care, the same device could have several objects --> No break
	// after
	// the successfull if in loop
	case Tango_POLL_REM_DEV:
	    Util.out5.println("Received a Rem device command");

	    dev_to_del = local_cmd.dev;
	    nb_elt = works.size();
	    for (i = 0; i < nb_elt; i++) {
		final WorkItem item = (WorkItem) works.elementAt(i);
		if (item.dev == dev_to_del) {
		    works.remove(i);
		    i--;
		}
	    }
	    break;

	// Update polling period
	case Tango_POLL_UPD_PERIOD:
	    Util.out5.println("Received a update polling period command");

	    dev_to_del = local_cmd.dev;
	    name_to_del = local_cmd.name;
	    type_to_del = local_cmd.type;

	    nb_elt = works.size();
	    for (i = 0; i < nb_elt; i++) {
		final WorkItem item = (WorkItem) works.elementAt(i);
		if (item.dev == dev_to_del) {
		    if (item.type == type_to_del) {
			if (item.name.equals(name_to_del)) {
			    item.update = local_cmd.new_upd;
			    break;
			}
		    }
		}
	    }
	    break;

	// Start polling
	case Tango_POLL_START:
	    Util.out5.println("Received a Start polling command");
	    polling_stop = false;
	    break;

	// Stop polling
	case Tango_POLL_STOP:
	    Util.out5.println("Received a Stop polling command");
	    polling_stop = true;
	    break;
	}

	// Inform requesting thread that the work is done
	{
	    // omni_mutex_lock sync(p_mon);
	    shared_cmd.cmd_pending = false;
	    p_mon.signal();
	}

	if (Util._tracelevel >= 5) {
	    print_list();
	}

    }
202008
def performAction(self, action):
        
#        print "ACTION:", action
        self.t += 1
        Task.performAction(self, action)
#        self.addReward()
        self.samples += 1
227911
@Override
    protected void doPerform() {
        org.openqa.selenium.Keys seleniumKeys = org.openqa.selenium.Keys.getKeyFromUnicode(keys.getKeyCode());
        if (isSourceDocumentRoot()) {
            keyboard().pressKey(seleniumKeys);
        } else {
            getActions().keyDown(getFirstElement(), seleniumKeys).perform();
        }
    }
1130474
def _on_action_triggered(self):
        
        action = self.sender()
        assert isinstance(action, QtWidgets.QAction)
        path = action.data()
        self.open_requested.emit(path)
        self.update_actions()