Prepend actions to action state execution list.

@param flow          the flow
@param actionStateId the action state id
@param actions       the actions
426645
public void prependActionsToActionStateExecutionList(final Flow flow, final String actionStateId, final EvaluateAction... actions) {
        addActionsToActionStateExecutionListAt(flow, actionStateId, 0, actions);
    }
149889
public boolean containsFlowState(final Flow flow, final String stateId) {
        if (flow == null) {
            LOGGER.error("Flow is not configured correctly and cannot be null.");
            return false;
        }
        return flow.containsState(stateId);
    }
693589
@SuppressWarnings("unchecked")
  public void updateExecutions() {
    this.updaterStage.set("Starting update all flows.");
    final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap();
    final ArrayList<ExecutableFlow> finalizeFlows =
        new ArrayList<>();

    for (final Map.Entry<Optional<Executor>, List<ExecutableFlow>> entry : exFlowMap
        .entrySet()) {

      final Optional<Executor> executorOption = entry.getKey();
      if (!executorOption.isPresent()) {
        for (final ExecutableFlow flow : entry.getValue()) {
          logger.warn("Finalizing execution " + flow.getExecutionId()
              + ". Executor id of this execution doesn't exist");
          finalizeFlows.add(flow);
        }
        continue;
      }
      final Executor executor = executorOption.get();

      this.updaterStage.set("Starting update flows on " + executor.getHost() + ":"
          + executor.getPort());

      Map<String, Object> results = null;
      try {
        results = this.apiGateway.updateExecutions(executor, entry.getValue());
      } catch (final ExecutorManagerException e) {
        handleException(entry, executor, e, finalizeFlows);
      }

      if (results != null) {
        final List<Map<String, Object>> executionUpdates =
            (List<Map<String, Object>>) results
                .get(ConnectorParams.RESPONSE_UPDATED_FLOWS);
        for (final Map<String, Object> updateMap : executionUpdates) {
          try {
            final ExecutableFlow flow = updateExecution(updateMap);

            this.updaterStage.set("Updated flow " + flow.getExecutionId());

            if (ExecutionControllerUtils.isFinished(flow)) {
              finalizeFlows.add(flow);
            }
          } catch (final ExecutorManagerException e) {
            final ExecutableFlow flow = e.getExecutableFlow();
            logger.error(e);

            if (flow != null) {
              logger.warn("Finalizing execution " + flow.getExecutionId());
              finalizeFlows.add(flow);
            }
          }
        }
      }
    }

    this.updaterStage.set("Finalizing " + finalizeFlows.size() + " error flows.");

    for (final ExecutableFlow flow : finalizeFlows) {
      this.executionFinalizer
          .finalizeFlow(flow, "Not running on the assigned executor (any more)", null);
    }

    this.updaterStage.set("Updated all active flows. Waiting for next round.");
  }
340069
@SafeVarargs
    private final <U> SimpleReactStream<U> reactI(final Supplier<U>... actions) {

        return new SimpleReactStreamImpl<U>(
                                            this, Stream.of(actions)
                                                        .map(next -> CompletableFuture.supplyAsync(next, executor)));

    }
86172
public ActionState createActionState(final Flow flow, final String name, final Action action) {
        return createActionState(flow, name, new Action[]{action});
    }
798838
public void addActionsToActionStateExecutionListAt(final Flow flow, final String actionStateId, final int position, final EvaluateAction... actions) {
        val actionState = getState(flow, actionStateId, ActionState.class);
        val currentActions = new ArrayList<Action>();
        val actionList = actionState.getActionList();
        actionList.forEach(currentActions::add);
        val index = position < 0 || position == Integer.MAX_VALUE ? currentActions.size() : position;
        currentActions.forEach(actionList::remove);
        Arrays.stream(actions).forEach(a -> currentActions.add(index, a));
        actionList.addAll(currentActions.toArray(Action[]::new));
    }
1068820
protected void createRenewCheckActionState(final Flow flow) {
        val action = createActionState(flow, CasWebflowConstants.STATE_ID_RENEW_REQUEST_CHECK, CasWebflowConstants.ACTION_ID_RENEW_AUTHN_REQUEST);
        createTransitionForState(action, CasWebflowConstants.TRANSITION_ID_PROCEED, CasWebflowConstants.STATE_ID_GENERATE_SERVICE_TICKET);
        createTransitionForState(action, CasWebflowConstants.TRANSITION_ID_RENEW, CasWebflowConstants.STATE_ID_SERVICE_AUTHZ_CHECK);
        createStateDefaultTransition(action, CasWebflowConstants.STATE_ID_SERVICE_AUTHZ_CHECK);
    }
835083
public void addIndependentAction(I_CmsListAction action) {

        action.setListId(getListId());
        m_indepActions.addIdentifiableObject(action.getId(), action);
    }
130893
protected void addActionKeyBinding(KeyStroke key, String actionKey) {
		if (actionKey == finishCommand.getId()) {
			addActionKeyBinding(key, actionKey, finishCommand.getActionAdapter());
		}
		else if (actionKey == cancelCommand.getId()) {
			addActionKeyBinding(key, actionKey, cancelCommand.getActionAdapter());
		}
		else {
			throw new IllegalArgumentException("Unknown action key " + actionKey);
		}
	}
143075
public void finishFlow(final String code, final String state) throws ApiException {
        if (account == null)
            throw new IllegalArgumentException("Auth is not set");
        if (codeVerifier == null)
            throw new IllegalArgumentException("code_verifier is not set");
        if (account.getClientId() == null)
            throw new IllegalArgumentException("client_id is not set");
        StringBuilder builder = new StringBuilder();
        builder.append("grant_type=");
        builder.append(encode("authorization_code"));
        builder.append("&client_id=");
        builder.append(encode(account.getClientId()));
        builder.append("&code=");
        builder.append(encode(code));
        builder.append("&code_verifier=");
        builder.append(encode(codeVerifier));
        update(account, builder.toString());
    }
584646
public void setPendingActions(java.util.Collection<String> pendingActions) {
        if (pendingActions == null) {
            this.pendingActions = null;
            return;
        }

        this.pendingActions = new com.amazonaws.internal.SdkInternalList<String>(pendingActions);
    }
727225
def addAction(self, action):
        
        self.ACTIONS.append(action)
        return "ACTION#{}".format(len(self.ACTIONS) - 1)
149222
@Override
    public void addAction(final LifecycleStage stage, final LifecycleAction<T> action)
    {
        stageEvents.add(new StageEvent(stage, action));
    }
836405
def setActions(self, actions):
        
        self.clear(autoBuild=False)
        for action in actions:
            self.addAction(action, autoBuild=False)
        self.rebuild()
481890
@Override
	public void addActions(String nodeID, Tree config) {
		Tree actions = config.get("actions");
		String serviceName = config.get("name", "");
		int actionCounter = 0;

		final long stamp = lock.writeLock();
		try {
			if (actions != null && actions.isMap()) {
				for (Tree actionConfig : actions) {
					actionConfig = actionConfig.clone();
					actionConfig.putObject("nodeID", nodeID, true);
					String actionName = actionConfig.get("name", "");

					// Register remote action
					RemoteActionEndpoint endpoint = new RemoteActionEndpoint(this, transporter, nodeID, actionConfig,
							actionName);
					Strategy<ActionEndpoint> actionStrategy = strategies.get(actionName);
					if (actionStrategy == null) {
						actionStrategy = strategyFactory.create();
						strategies.put(actionName, actionStrategy);
					}
					actionStrategy.addEndpoint(endpoint);

					// Apply middlewares
					for (Middleware middleware : middlewares) {
						endpoint.use(middleware);
					}

					// Write log about this action
					logger.info("Action \"" + actionName + "\" on node \"" + nodeID + "\" registered.");
					actionCounter++;
				}
			}
			names.add(serviceName);
		} finally {
			lock.unlockWrite(stamp);
		}

		// Write log about this service
		StringBuilder msg = new StringBuilder(64);
		msg.append("Remote service \"");
		msg.append(serviceName);
		msg.append("\" registered ");
		if (actionCounter == 0) {
			msg.append("without any actions");
		} else if (actionCounter == 1) {
			msg.append("with 1 action");
		} else {
			msg.append("with ");
			msg.append(actionCounter);
			msg.append(" actions");
		}
		msg.append(" on node \"");
		msg.append(nodeID);
		msg.append("\".");
		logger.info(msg.toString());

		// Notify local listeners about the new REMOTE service
		broadcastServicesChanged(false);
	}
931533
function(action, implementation){
            this.resolvableActions                      = this.resolvableActions                        || {};
            this.resolvableActions[action]              = this.resolvableActions[action]                || {};
            this.resolvableActions[action].actionName   = this.resolvableActions[action].actionName     || action;

            implementation = implementation || RL.ResolvableAction.Types[action];
            this.resolvableActions[action] = Object.create(implementation);
            // merge could be used instead of Object.create but is less desirable
            // RL.Util.merge(this.resolvableAction.Types[action], implementation);

            if(this.resolvableActions[action].init){
                this.resolvableActions[action].init.call(this);
            }
        }
573037
@Override
    @Deprecated
    public void forEachRemaining(java.util.function.Consumer<? super Pair<A, B>> action) {
        super.forEachRemaining(action);
    }