MTF main configuration

The MTF package includes different configuration files. However, you generally need to edit only the main configuration file config.xml.

When MTF is launched for the first time, it is based on the indications included in the file config.xml .

The file config.xml defines the web service address of the module, the list of jobs along with their tasks, their schedule, and some other parameters.

A typical config.xml file looks like this:

<?xml version="1.0"?>
<SchedulerConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sistemaits.com">
	<WebServiceBaseAddress>http://localhost:8080/mtf/</WebServiceBaseAddress>
	<Jobs>
		
		<!-- Simulation of day types -->
		<MidTermForecastDayTypes Name="DayTypes">
			<ApplicationPath>C:\Optima\MTF\TRE\TRE.exe</ApplicationPath>
			<DbConnectionString>Server=localhost;Port=5432;User Id=postgres;Password=postgres;ApplicationName=SISTeMA Mid-Term Forecast;Database=optima;CommandTimeout=3600;</DbConnectionString>
			<DayTypes>10,2</DayTypes>
		</MidTermForecastDayTypes>

		<!-- Simulation of the rest of the day: each our, from that moment until midnight -->
		<JobConfiguration Name="RestOfDay" Enabled="true">
			<CronSchedule>0 0 * * * ? *</CronSchedule>
			<AbortOnTaskFailure>true</AbortOnTaskFailure>
			<Tasks>
				<Task Order="1" Name="CreateTable">
					<ExecutionType>SQL</ExecutionType>
					<Parameters>
						<ConnectionString>Server=localhost;Port=5432;User Id=postgres;Password=postgres;ApplicationName=SISTeMA Mid-Term Forecast;Database=optima;CommandTimeout=3600;</ConnectionString>
						<Query>SELECT mtf_create_nextday('rlin_tsys_tre_rltm_{{{DateOf(now)}}}', {{{DateOf(now)}}});</Query>
					</Parameters>
				</Task>
				<TRE Order="2" Name="MidTerm">
					<ApplicationPath>C:\Optima\MTF\TRE\TRE.exe</ApplicationPath>
					<Parameters>
						<SDAY>{{{DateOf(now)}}}</SDAY>
						<SimInitHHMMSS>{{{now.ToString("HH") &amp; "0000"}}}</SimInitHHMMSS>
						<SimSpan>{{{(24 - now.Hour) * 3600}}}</SimSpan>
					</Parameters>
					<ExecutionType>NewProcess</ExecutionType>
				</TRE>
			</Tasks>
		</JobConfiguration>
	</Jobs>
</SchedulerConfiguration>

Important:  For more details on this table, see rlin_tsys_tre_rltm. To learn more on SDAY, see sday (parameter).

Important:  Please note that the XML nodes ApplicationPath and DefaultApplicationPath included in the config.xml file can accept both the .exe (Windows only) and the .dll (Windows or Linux) extension types.

Furthermore, the MTF package includes other templates in the installation path <OPTIMA_INSTALL_PATH>/MTF/Config-Templates that you can use to customize the main configuration file config.xml. They are:

Important:  For additional details on installation paths for Optima components, see Optima Installation Conventions.

In order to customize the main configuration file, you can either:

  1. Replace the original config.xml main configuration file with one of the above-mentioned template files. In this case, the main file's name must be edited (for example:  config_old.xml) and the template file chosen must be renamed as config.xml.

  2. Copy and paste only the template file section that you need in the right hierarchy of the main configuration file config.xml. In the following example, you can see a template section (highlighted in blue) that was added to the main configuration file:

<?xml version="1.0"?>
<SchedulerConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sistemaits.com">
	<WebServiceBaseAddress>http://localhost:8080/mtf/</WebServiceBaseAddress>
	<Jobs>
		<!-- Simulation of next week -->
		<MidTermForecastNextDays Name="Week" Enabled="true">
			<ApplicationPath>C:\Optima\MTF\TRE\TRE.exe</ApplicationPath>
			<DbConnectionString>Server=localhost;Port=5432;User Id=postgres;Password=postgres;ApplicationName=SISTeMA Mid-Term Forecast;Database=optima;CommandTimeout=3600;</DbConnectionString>
			<NumberOfDays>7</NumberOfDays>
		</MidTermForecastNextDays>

		<!-- Simulation of day types -->
		<MidTermForecastDayTypes Name="DayTypes">
			<ApplicationPath>C:\Optima\MTF\TRE\TRE.exe</ApplicationPath>
			<DbConnectionString>Server=localhost;Port=5432;User Id=postgres;Password=postgres;ApplicationName=SISTeMA Mid-Term Forecast;Database=optima;CommandTimeout=3600;</DbConnectionString>
			<DayTypes>10,2</DayTypes>
		</MidTermForecastDayTypes>

		<!-- Simulation of the rest of the day: each our, from that moment until midnight -->
		<JobConfiguration Name="RestOfDay" Enabled="true">
			<CronSchedule>0 0 * * * ? *</CronSchedule>
			<AbortOnTaskFailure>true</AbortOnTaskFailure>
			<Tasks>
				<Task Order="1" Name="CreateTable">
					<ExecutionType>SQL</ExecutionType>
					<Parameters>
						<ConnectionString>Server=localhost;Port=5432;User Id=postgres;Password=postgres;ApplicationName=SISTeMA Mid-Term Forecast;Database=optima;CommandTimeout=3600;</ConnectionString>
						<Query>SELECT mtf_create_nextday('rlin_tsys_tre_rltm_{{{DateOf(now)}}}', {{{DateOf(now)}}});</Query>
					</Parameters>
				</Task>
				<TRE Order="2" Name="MidTerm">
					<ApplicationPath>C:\Optima\MTF\TRE\TRE.exe</ApplicationPath>
					<Parameters>
						<SDAY>{{{DateOf(now)}}}</SDAY>
						<SimInitHHMMSS>{{{now.ToString("HH") &amp; "0000"}}}</SimInitHHMMSS>
						<SimSpan>{{{(24 - now.Hour) * 3600}}}</SimSpan>
					</Parameters>
					<ExecutionType>NewProcess</ExecutionType>
				</TRE>
			</Tasks>
		</JobConfiguration>
	</Jobs>
</SchedulerConfiguration>

Important:  When successfully installed, MTF stores its simulation results from the past day on a daily basis at midnight in specific tables: to learn more about this, check out → Modeling simulations