Search in sources :

Example 6 with ParameterMap

use of io.engineblock.activityimpl.ParameterMap in project engineblock by engineblock.

the class ScenarioController method modify.

/**
 * Modify one of the parameters in a defined activity. Any observing activity components will be notified of the
 * changes made to activity parameters.
 *
 * @param alias The name of an activity that is already known to the scenario.
 * @param param The parameter name
 * @param value a new parameter value
 */
public synchronized void modify(String alias, String param, String value) {
    if (param.equals("alias")) {
        throw new InvalidParameterException("It is not allowed to change the name of an existing activity.");
    }
    ActivityExecutor activityExecutor = getActivityExecutor(alias);
    ParameterMap params = activityExecutor.getActivityDef().getParams();
    params.set(param, value);
}
Also used : InvalidParameterException(java.security.InvalidParameterException) ParameterMap(io.engineblock.activityimpl.ParameterMap)

Example 7 with ParameterMap

use of io.engineblock.activityimpl.ParameterMap in project engineblock by engineblock.

the class ScenarioController method run.

public synchronized void run(int timeout, Map<String, String> activityDefMap) {
    ActivityDef ad = new ActivityDef(new ParameterMap(activityDefMap));
    run(timeout, ad);
}
Also used : ActivityDef(io.engineblock.activityimpl.ActivityDef) ParameterMap(io.engineblock.activityimpl.ParameterMap)

Aggregations

ParameterMap (io.engineblock.activityimpl.ParameterMap)7 ActivityDef (io.engineblock.activityimpl.ActivityDef)3 InvalidParameterException (java.security.InvalidParameterException)1 Test (org.testng.annotations.Test)1