Adds a new when clause to this case.

@param condition condition to verify.
@param action action to be executed if the condition is true.
@return this case.
506149
public Case when(final Expression condition, final Expression action) {
        whens.add(When.when(condition, action));
        return this;
    }
409098
public RolloutGroupConditionBuilder successAction(final RolloutGroupSuccessAction action, final String expression) {
        conditions.setSuccessAction(action);
        conditions.setSuccessActionExp(expression);
        return this;
    }
387377
public static Case caseWhen(final Expression condition, final Expression trueAction) {
        return Case.caseWhen(condition, trueAction);
    }
498618
public void addViewAction(final String actionId, final ActorConsumer<?, ?> action) {
        parser.getData().addActorConsumer(actionId, action);
    }
682358
private static void addAction(@Nonnull Computer c, @Nonnull Action a) {
        try {
            c.addAction(a);
        } catch (UnsupportedOperationException x) {
            try {
                Field actionsF = Actionable.class.getDeclaredField("actions");
                actionsF.setAccessible(true);
                @SuppressWarnings("unchecked")
                List<Action> actions = (List) actionsF.get(c);
                actions.add(a);
            } catch (Exception x2) {
                LOGGER.log(Level.WARNING, null, x2);
            }
        }
    }
1249951
private function actionIs($conjunction, $action)
    {
        if (!empty($this->expression)) {
            $this->expression[] = $conjunction;
        }

        $index              = \count($this->variables);
        $this->expression[] = \sprintf(self::ACTION_IS_EXPRESSION, $index);
        $this->variables[]  = $action;
        $this->compiled     = null;

        return $this;
    }
146117
@Check(CheckType.FAST)
	public void checkActionFires(SarlAction action) {
		for (final JvmTypeReference event : action.getFiredEvents()) {
			final LightweightTypeReference ref = toLightweightTypeReference(event);
			if (ref != null && !this.inheritanceHelper.isSarlEvent(ref)) {
				error(MessageFormat.format(
						Messages.SARLValidator_57,
						event.getQualifiedName(),
						Messages.SARLValidator_62,
						this.grammarAccess.getFiresKeyword()),
						event,
						null,
						ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
						INVALID_FIRING_EVENT_TYPE,
						event.getSimpleName());
			}
		}
	}
25892
protected void executeAction(Action action) {
        ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime());
        context.setNodeInstance(this);
        try {
            action.execute(context);
        } catch (Exception e) {
            String exceptionName = e.getClass().getName();
            ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
                resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName);
            if (exceptionScopeInstance == null) {
                throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e);
            }
            
            exceptionScopeInstance.handleException(exceptionName, e);
            cancel();
        }
    }
562003
@Override
    public void doAction(Action action) {
        BaseComponent parent = getParent();
        
        switch (action) {
            case REMOVE:
                ActionListener.unbindActionListeners(this, actionListeners);
                detach();
                break;
            
            case HIDE:
            case COLLAPSE:
                setVisible(false);
                break;
            
            case SHOW:
            case EXPAND:
                setVisible(true);
                break;
            
            case TOP:
                parent.addChild(this, 0);
                break;
        }
        
        if (parent != null) {
            EventUtil.post(MainController.ALERT_ACTION_EVENT, parent, action);
        }
    }
1344799
public void setAction(String action) throws ApplicationException {
	if (StringUtil.isEmpty(action)) return;
	action = action.toLowerCase().trim();
	if (action.equals("run")) this.action = ACTION_RUN;
	else if (action.equals("delete")) this.action = ACTION_DELETE;
	else if (action.equals("update")) this.action = ACTION_UPDATE;
	else if (action.equals("list")) this.action = ACTION_LIST;
	else if (action.equals("lists")) this.action = ACTION_LIST;
	else if (action.equals("pause")) this.action = ACTION_PAUSE;
	else if (action.equals("resume")) this.action = ACTION_RESUME;
	else throw new ApplicationException("attribute action with value [" + action + "] of tag schedule is invalid",
		"valid attributes are [delete,run,update,list,resume,pause]");
    }
626641
public void updateAction(Action action)
	{
		action.putValue(Action.NAME, myMessageProvider.getMessage(getLabelMessage(), getLocale()));
		action.putValue(Action.SHORT_DESCRIPTION, myMessageProvider.getMessage(getLabelDescription(), getLocale()));
		if (IS_NOT_EMPTY.test(getKeyboardShortcut()))
		{
			action.putValue(Action.ACCELERATOR_KEY, KeyboardRepresentationTable.getKeyStroke(getKeyboardShortcut()));
		}
		else
		{
			action.putValue(Action.ACCELERATOR_KEY, null);
		}
	}
1217733
public ZealotKhala doAnything(ICustomAction action) {
        SqlInfo sqlInfo = this.source.getSqlInfo();
        action.execute(sqlInfo.getJoin(), sqlInfo.getParams());
        return this;
    }
52240
@Override
    public void tryUnchecked(ActionToTry<E> action) {
        tryUnchecked(noParam -> {
            action.execute();
            return null;
        }, null);
    }
317457
public String translate(final When when) {
        inject(when.condition);
        inject(when.action);

        return String.format("WHEN %s THEN %s",
                             when.condition.translate(),
                             when.action.translate());
    }
316429
@Check(CheckType.FAST)
	public void checkActionName(SarlAction action) {
		final JvmOperation inferredType = this.associations.getDirectlyInferredOperation(action);
		final QualifiedName name = QualifiedName.create(inferredType.getQualifiedName('.').split("\\.")); //$NON-NLS-1$
		if (this.featureNames.isDisallowedName(name)) {
			final String validName = Utils.fixHiddenMember(action.getName());
			error(MessageFormat.format(
					Messages.SARLValidator_39,
					action.getName()),
					action,
					XTEND_FUNCTION__NAME,
					ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
					INVALID_MEMBER_NAME,
					validName);
		} else if (!isIgnored(DISCOURAGED_FUNCTION_NAME)
				&& this.featureNames.isDiscouragedName(name)) {
			warning(MessageFormat.format(
					Messages.SARLValidator_39,
					action.getName()),
					action,
					XTEND_FUNCTION__NAME,
					ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
					DISCOURAGED_FUNCTION_NAME);
		}
	}
866691
public Wait action(TestAction action) {
        if (action instanceof TestActionBuilder) {
            getCondition().setAction(((TestActionBuilder) action).build());
            this.action.setAction(((TestActionBuilder) action).build());
            getBuilder().actions(((TestActionBuilder) action).build());
        } else {
            getCondition().setAction(action);
            this.action.setAction(action);
            getBuilder().actions(action);
        }

        return getBuilder().build();
    }
1078394
public SqlBuilder where(String where) {
		if (StrUtil.isNotBlank(where)) {
			sql.append(" WHERE ").append(where);
		}
		return this;
	}