Starting a simulation
Enables you to start immediately a simulation or a simulation group.
Authentication phase
Before using the endpoint, you must run the authentication phase (→ Login).
After the authentication, a session opens and a valid session token persists until:
- The end of the session time-out, that is set through the parameter sessionTimeout (→ OptimaWSI configuration > OptimaAuth section).
- An explicit Logout call (→ Logout).

Request
POST
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/simulation/engine/{appname}/start
The parameter appname must be specified with the value TRE_tattico (that is also the default value).
Important: For legacy reasons and backward compatibility, STF is associated with the string TRE_tattico.
Request parameters
Parameter | Required | Description |
---|---|---|
force |
NO |
Boolean type. true: If the engine is not busy, starts a new simulation; otherwise, the current simulation is stopped, and a new one is triggered immediately. false: a new simulation is started if the simulation engine is not currently busy. Default value: false. |
Not applicable.
Request content-type
Not applicable.
Request body (payload)
Not applicable.

Response status
HTTP status | Description |
---|---|
200 OK |
The engine is processing the request. |
401 Unauthorized |
The requested resource is restricted and requires authentication. Please see → Login (deprecated). |
403 Forbidden |
TRE is currently busy with a running simulation (only if the query parameter force is false or not specified in the request). |
418 |
TRE is not reachable. |
Response content-type
application/xml
Response output
XML message containing information on the Short Term Forecast (STF) simulation engine.
In the XML message, the <status> tag indicates the processing status of the request:
- status = 0: the request is well formed and has been accounted with success.
- status = 1: internal error or wrong request (failed request).

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/simulation/engine/TRE_tattico/start
Response status
HTTP status | Description |
---|---|
200 OK |
Result of the processed request. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1" xmlns:ns2="http://datex2.eu/schema/2/2_0" xmlns:ns3="http://datex2.eu/schema/2/2_0/com/sistemaits/ext">
<exchange>
<provider>PTV-OPTIMA</provider>
</exchange>
<payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SimulationPayload">
<engine appName="TRE_TATTICO">
<status>0</status>
<Message>0</Message>
<TimeToNextSim>00:01:22</TimeToNextSim>
<init>66600</init>
<lastDay>-1</lastDay>
<Action>Waiting</Action>
<ends>0</ends>
<simt>2016-06-01 18:50:13 (+02:00)</simt>
<Progress>0.0</Progress>
<sday>01/06/2016 00:00:00</sday>
<simulationGroup idno="0">
<simulation idno="172173" base="false"/>
</simulationGroup>
</engine>
</payloadPublication>
</Orca2Model>
Additional Notes
An equivalent format for the request is:
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/simulation/engine/TRE_tattico/start?force
=true

In this example, the query parameter force is not specified.
Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/simulation/engine/TRE_tattico/start
Response status
HTTP status | Description |
---|---|
403 Forbidden |
TRE is currently busy with a running simulation. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1" xmlns:ns2="http://datex2.eu/schema/2/2_0">.
<error>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">
TRE is busy, please wait for it to be free before requesting a simulation
</error>
</Orca2Model>

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex-interface/simulation/engine/TRE_tattico/start
Response status
HTTP status | Description |
---|---|
418 |
TRE is not reachable. |
Response output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Orca2Model xmlns="http://sistemaits.com/orca2/1" xmlns:ns2="http://datex2.eu/schema/2/2_0">.
<error>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">
Error contacting PTV Short Term 'TRE_tattico' - Connection error 404 - HTTP/1.1 404 Not Found
</error>
</Orca2Model>