protected void doRun() throws Exception {
String scriptLocation = getCommandLine().getOptionValue('s');
ConfigSource configSource = getToolContext().getConfigSource();
ConfigMaster configMaster = getToolContext().getConfigMaster();
Scenario scenario = SimulationUtils.createScenarioFromDsl(scriptLocation, null);
ConfigItem<ScenarioDefinition> configItem = ConfigItem.of(scenario.createDefinition(), scenario.getName());
if (getCommandLine().hasOption('i')) {
ObjectId scenarioId = ObjectId.parse(getCommandLine().getOptionValue('i'));
UniqueId latestScenarioId = configSource.get(scenarioId, VersionCorrection.LATEST).getUniqueId();
configItem.setUniqueId(latestScenarioId);
configMaster.update(new ConfigDocument(configItem));