Hi Alexey,
Look like you are using PDI to add visits to tour. You may try out below sample ABSL script and see if it helps. Basically when you call the action 'CreateAddVisits', you need to pass the visit UUID to it.
In addition, in our 1502 release, we introduced a new BO 'ROUTE', it covers the functionality of VistTourPlan, and provide more features. So if you have the business scenario to create tour for visits, you may check how the new functionality works.
Regards,
Yufeng
import ABSL;
import AP.PC.ActivityManagement.Global;
import AP.FO.Activity.Global;
// creating a visit
var visitParameters: elementsof Activity;
visitParameters.SubjectName = "testVisit1";
visitParameters.ScheduledStartDateTime.content = GlobalDateTime.ParseFromString("2015-09-18T13:30:00Z");
visitParameters.ScheduledEndDateTime.content = GlobalDateTime.ParseFromString("2015-09-18T14:30:00Z");
visitParameters.TypeCode = "12";
visitParameters.GroupCode.content = "0027";
var visitInstance = Activity.Create(visitParameters);
// creating a tour
var tourParameters: elementsof VisitTourPlan;
tourParameters.Name = "testTour1";
tourParameters.StartDateTime = GlobalDateTime.ParseFromString("2015-08-18T13:30:00Z");
tourParameters.EndDateTime = GlobalDateTime.ParseFromString("2015-08-18T14:30:00Z");
tourParameters.ActivityTypeCode = "1";
var tourInstance = VisitTourPlan.Create(tourParameters);
// adding visit to a tour
tourInstance.CreateAddVisits(visitInstance.UUID);