schedule
schedule copied to clipboard
scheduling two tasks at the same time.
Hi, I'm trying to schedule two tasks at the same time on the same date that both require a particular resource whose isNotReservable
field is set to true
. As far as I understand, these two tasks should not conflict with one another; however, I can't get something like this to work. To be more explicit, the following data results in the scheduler successfully scheduling t2
, but failing to schedule t1
:
let tasks = [{
id: "t1",
duration: 1,
minLength: 1,
resources: ["r1"],
available: later.parse.text("after 1:00am and before 1:01am")
}, {
id: "t2",
duration: 1,
minLength: 1,
resources: ["r1"],
available: later.parse.text("after 1:00am and before 1:01am")
}];
let resources = [{
id: "r1",
available: later.parse.text("after 1:00am and before 1:01am"),
isNotReservable: true
}];
let start = new Date("2020-01-01");
let frequency = later.parse.text("on the 1 day of January in 2020");
let s = schedule.create(tasks, resources, frequency, start);
Is this expected behavior? Or, perhaps I'm doing something wrong?
@mgoldenberg Were you able to solve this? I'm running into the same problem in my early testing of this library. I know this project is no longer maintained but I haven't been able to find an alternative. Thanks in advance.
@mgcox2: I tried and tried, but to no avail. If you manage to find a solution, do let me know.
@mgoldenberg: Try adding the priority option to your tasks. The task with the higher priority should be scheduled, the other should not.
@mgcox2: the problem I had was not due to a priority issue as far as I can tell. It isn't that I want t1
scheduled as opposed to t2
. It is that I want both scheduled at the same time. Since the resource has it's isNotReservable
flag set to true
, this should not be an issue.
@mgoldenberg have you found a solution to this issue?
Unfortunately, I never did. I had started digging through the source, but then I got bored... alas.