DATEX II demand events
The standard DATEX II manages demand events (for example, <situationRecord> node with type set to OptimaDemandEvent). .
Optima provides additional capabilities, added as DATEX II extensions:
Important: Before creating or updating a demand event, you can read Optima demand events through the API → Getting all traffic events.
All demand events properties are under the main node <d2LogicalModel>/<payloadPublication>/<situation>/<situationRecord>.
In the table, the relevant properties for demand events, with additional properties provided by the extensions.
Property | DATEX II Optima extensions | Description |
---|---|---|
|
YES |
Contains the zone associated to the event. |
|
YES |
zoneID is the identifier of the referenced zone, present in the model. |
|
YES |
Contains the number of vehicles associated to the specified zone (entering or exiting). |
|
YES |
Admitted values:
|
|
YES |
Admitted values: for the new field optimaDemandEventType you can specify all the values associated to the standard DATEX II element: <xs:simpleType name="PublicEventTypeEnum"> Example: rugbyMatch |

Currently, the <validity> admitted is expressed through a well defined structure, as shown in this fragment of XML:
<validity>
<validityStatus>definedByValidityTimeSpec</validityStatus>
<validityTimeSpecification>
<overallStartTime>2016-08-05T00:30:00.000+02:00</overallStartTime>
<overallEndTime>2016-08-05T00:30:00.000+02:00</overallEndTime>
</validityTimeSpecification>
</validity>
Both overallStartTime e overallEndTime are mandatory.

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex2import/optima/?publish=TRUE
Request body (payload)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<d2LogicalModel xmlns="http://datex2.eu/schema/2/2_0">
<exchange>
<supplierIdentification>
<country>other</country>
<nationalIdentifier>OPTIMA</nationalIdentifier>
</supplierIdentification>
</exchange>
<payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SituationPublication" lang="other">
<publicationTime>2021-09-30T12:56:10.236+02:00</publicationTime>
<publicationCreator>
<country>other</country>
<nationalIdentifier>OPTIMA</nationalIdentifier>
</publicationCreator>
<situation id="OPTIMA_DEMAND_EVENT_2_FROM_D2_ENDPOINT" version="1">
<headerInformation>
<confidentiality>noRestriction</confidentiality>
<informationStatus>real</informationStatus>
</headerInformation>
<situationRecord xsi:type="OptimaDemandEvent" id="OPTIMA_DEMAND_EVENT_MARIO_FROM_D2_ENDPOINT" version="1">
<situationRecordCreationTime>2016-08-05T13:24:00.000+02:00</situationRecordCreationTime>
<situationRecordVersionTime>2021-09-21T11:51:40.930+02:00</situationRecordVersionTime>
<severity>none</severity>
<source>
<sourceCountry>other</sourceCountry>
<sourceIdentification>OPTIMA</sourceIdentification>
</source>
<validity>
<validityStatus>definedByValidityTimeSpec</validityStatus>
<validityTimeSpecification>
<overallStartTime>2016-08-05T00:30:00.000+02:00</overallStartTime>
<overallEndTime>2016-08-05T01:30:00.000+02:00</overallEndTime>
</validityTimeSpecification>
</validity>
</situationRecord>
</situation>
</payloadPublication>
</d2LogicalModel>

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/datex2import/optima/?publish=TRUE
Request body (payload)
<ns2:situationRecord xmlns="http://datex2.eu/schema/2/2_0" xmlns:ns2="eu.datex2.schema._2._2_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="OptimaDemandEvent" id="OPTIMA_DEMAND_EVENT_MARIO_FROM_D2_ENDPOINT" version="2">
<situationRecordCreationTime>2016-08-05T13:24:00.000+02:00</situationRecordCreationTime>
<situationRecordVersionTime>2022-02-09T15:23:34.793+01:00</situationRecordVersionTime>
<severity>none</severity>
...
<groupOfLocations xsi:type="ZoneLocationTDE">
<zoneId>-16</zoneId>
</groupOfLocations>
<numberOfVehicle>30</numberOfVehicle>
<zoneIsAttracting>true</zoneIsAttracting>
<optimaDemandEventType>rugbyMatch</optimaDemandEventType>
</ns2:situationRecord>