fork(1) download
  1. Public class ServiceResourceScheduleHandlerImpl implements lxscheduler.ServiceResourceScheduleHandler{
  2.  
  3. // The main interface method.
  4. public static List<lxscheduler.ServiceResourceSchedule> getUnavailableTimeslots(lxscheduler.ServiceAppointmentRequestInfo requestInfo){
  5. //Request info values.
  6. List<lxscheduler.ServiceResourceInfo> serviceResources=requestInfo.getServiceResources();
  7. DateTime startDate=requestInfo.getStartDate();
  8. DateTime endDate=requestInfo.getEndDate();
  9.  
  10.  
  11. List<lxscheduler.ServiceResourceSchedule> resourceUnavailability = new List<lxscheduler.ServiceResourceSchedule>();
  12. Set<lxscheduler.UnavailableTimeslot> unavailabilityIntervals = new Set<lxscheduler.UnavailableTimeslot>();
  13.  
  14. //This is a dummy response. Implement your own business logic to connect to your internal or external systems.
  15. for (Integer i = 0; i < 5; i++) {
  16. //Set the unavailability intervals of a service resource.
  17. unavailabilityIntervals.add(new lxscheduler.UnavailableTimeslot(startDate.addMinutes(15*i),startDate.addMinutes(15*(i+1))));
  18. }
  19.  
  20. for (lxscheduler.ServiceResourceInfo ServiceResource:serviceResources) {
  21. //Set the unavailability of Service resource.
  22. resourceUnavailability.add(new lxscheduler.ServiceResourceSchedule(serviceResource.getServiceResourceId(),unavailabilityIntervals));
  23.  
  24. }
  25.  
  26. return resourceUnavailability;
  27. }
  28. }
Success #stdin #stdout #stderr 0.01s 8988KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #ServiceResourceScheduleHandlerImpl
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #ServiceResourceScheduleHandlerImpl (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:1: expected expression