Why does the tourid change?

This forum deals with any kind of trip optimization whether it is automatic planning or manual dispatching, refering to transport orders or service planning.

Why does the tourid change?

Postby CB* » Fri Jan 05, 2018 9:37 am


I am calculating a input tour with the following parameters:

<Tour ... id="9900005157" tourPointFixation="NO_TOUR_POINT_OUT" ...

In the result i am getting

<ns4:Tour ... id="1310070565" ...

When the tour is fixed, I would expect to get the same id back in a successful request .

You can find my request attached.
I am using xTour

(18.43 KiB) Downloaded 50 times
Posts: 1
Joined: Fri Apr 07, 2017 1:57 pm

Re: Why does the tourid change?

Postby Joost » Fri Jan 05, 2018 11:48 am

I took a quick look, looks like your tourId is bigger then a regular integer can be and there is an internal overflow.

9900005157 mod 2147483647 = 1310070565

Are you working with SAP by any chance? I had a similar issue some time ago where the integers from our interface where mapped against int8 instead of i type in SAP.
Joost Claessen
Senior Technical Consultant
PTV Benelux
Posts: 203
Joined: Fri Apr 25, 2014 1:46 pm

Re: Why does the tourid change?

Postby Bernd Welter » Fri Jan 05, 2018 1:06 pm

Looks like this topic hits both TourIDs and OrderIDs.
Long story short: as Joost explained it is caused by buffer overflow of the integers and produces an exception (Order ID) or a "replacement" (TourID).

For those (SAP based) users who ran into the issue: you need a mapping between your IDs (however they aber based) and some valid INTs.

The xTour2 API deals with string based IDs instead of INTs, so the problem won't occur anymore.

Besr regards,

PS: your depot has more than 1000 intervals covering a period of 3.4 years. A bit weird if you ask me ;-)
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
Posts: 1054
Joined: Mon Apr 14, 2014 10:28 am

Return to PTV xTourServer