Support for v6.x of our Scheduling components


Post by friedj »

Dear Bryntum Team,

I have a question regarding the project and task specific calendars.

We have the following setup:

  • Project specific calendar.

  • Base calendars.

  • Person specific calendars which are assigned to tasks and extends a base calendar.

Each task has a responsible, based on the task responsible a person specific calendar is assigned to the task. Even though I set the hoursPerDay config for the person specific calendar the system does not take into account.

If I set the hoursPerDay config for the project specific calendar, then it works, but in this case the duration calculation is not consistent.

Please consider the following example:
[1] Task A responsible is User A
[2] Task B responsible is User B
[3] User A availability is: 08:00-16:00
[4] User B availability is: 08:00-12:00
[5] User A works 8 hours per day
[6] User B works 4 hours per day

For the User A's calendar I would like to set the hoursPerDay to 8, for the User B's calendar I would like to set the hoursPerDay to 4. Right now even though I set these configs. the system does not take into account.
In this case I can not set a common hoursPerDay config for the project specific calendar, because the duration calculation will be incorrect either for User A or for User B.
Do you have any hints/support? Thank you very much!


Post by Maxim Gorkovsky »

Hello.
Could you please elaborate on this:

Right now even though I set these configs. the system does not take into account.

What is the problem exactly? It would help to see your data and tasks

HoursPerDay value is used to convert hours to days. Task duration is always expressed according to the project calendar. For example:
Project calendar is 24 hours. Task A duration is 1 day. Task A duration in hours would be 24. Now, if we change project calendar to be 8 hours, Task A duration in hours would be 8.


Post by friedj »

Hello,

Thank you very much your quick response.
You understood correctly, what if I want task specific work hours per day?
I mean the task has different responsibles assigned (as my above example shows) and different responsible has different work hours per day.
If we take my above example: in case the two tasks has the same start date and I set a duration of 1 for both tasks the system should calculate the end date of each task according to tasks calendar work hours and not the project calendar work hours.
In conclusion I would like to have task specific work hours. Is this possible?

Concrete example:
Task A starts at: 2021-11-01 08:00
Task B starts at: 2021-11-01 08:00
User A availability is: 08:00-16:00
User B availability is: 08:00-12:00
User A works 8 hours per day
User B works 4 hours per day
I set a duration of 1 for both tasks

Expected calculated end date:
Task A: 2021-11-01 16:00
Task B: 2021-11-01 12:00

The real calculated end date:
Task A: 2021-11-01 16:00
Task B: 2021-11-02 12:00

The real calculated end date for Task B is not correct because the system calculates with 8 hours/day and not with 4 hours/day.
Is there a way to use task specific work hours? I mean the task has a calendar and this calendar has a work hour config which overrides the project specific work hours => is this possible? Thank you very much!


Post by Maxim Gorkovsky »

To avoid confusion I would recommend to set duration in hours, rather than in days. This should do the trick:

{
  Name : 'Task A',
  StartDate : '2021-11-01T08:00',
  Duration : 8,
  DurationUnit : 'h'
},
{
  Name : 'Task B',
  StartDate : '2021-11-01T08:00',
  Duration : 4,
  DurationUnit : 'h'
}

Post by friedj »

Hello!

Thank you for your feedback, I am not sure if this helps.
Even though I set the duration in hours the work hours/day stays the same, so for Task B setting a duration of 6 hours should shift the end date to 2021-11-02, if the Task B's calendar work hours are set to 4 hours per day.
Is there any possibility to have task specific work hours? (task specific calendars which overrides the project specific work hours).


Post by Maxim Gorkovsky »

This is what happens for me locally on the following dataset:

{
    "success"      : true,
    "calendars"    : {
        "metaData" : {
            "projectCalendar" : "General"
        },
        "rows"     : [
            {
                "Id"                  : "General",
                "Name"                : "General",
                "parentId"            : null,
                "DaysPerWeek"         : 7,
                "DaysPerMonth"        : 30,
                "HoursPerDay"         : 8,
                "WeekendFirstDay"     : 6,
                "WeekendSecondDay"    : 0,
                "WeekendsAreWorkdays" : false,
                "DefaultAvailability" : [
                    "08:00-16:00"
                ],
                "leaf"                : true
            },
            {
                "Id"                  : "NightShift",
                "Name"                : "Night Shift",
                "parentId"            : null,
                "DaysPerWeek"         : 5,
                "DaysPerMonth"        : 20,
                "HoursPerDay"         : 4,
                "WeekendFirstDay"     : 6,
                "WeekendSecondDay"    : 0,
                "WeekendsAreWorkdays" : false,
                "leaf"                : true,
                "DefaultAvailability" : [
                    "08:00-12:00"
                ]
            }
        ]
    },
    "assignments"  : {
        "rows" : [
            {
                "Id"         : 1,
                "TaskId"     : 1,
                "ResourceId" : 1,
                "Units"      : 100
            },
            {
                "Id"         : 2,
                "TaskId"     : 2,
                "ResourceId" : 2,
                "Units"      : 100
            }
        ]
    },
    "resources"    : {
        "rows" : [
            {
                "Id"         : 1,
                "Rate"       : 180,
                "PerUseCost" : 180,
                "Name"       : "Mats"
            },
            {
                "Id"         : 2,
                "Rate"       : 180,
                "PerUseCost" : 500,
                "CalendarId" : "NightShift",
                "Name"       : "Nickolay"
            }
        ]
    },
    "tasks"        : {
        "metaData" : {
            "projectStartDate" : "2021-11-01"
        },
        "rows"     : [
            {
                "Id"                : 1000,
                "Name"              : "Project A",
                "Description"       : "Project A description",
                "AllowDependencies" : true,
                "iconCls"           : "projectIcon",
                "expanded"          : true,
                "children"          : [
                    {
                        "Id"                : 1,
                        "Name"              : "Planning",
                        "StartDate"         : "2021-11-01T08:00",
                        "EndDate"           : "2021-11-01T16:00",
                        "leaf"              : true,
                        "Rollup"            : true
                    },
                    {
                        "Id"                : 2,
                        "Cls"               : "LowPrio",
                        "Name"              : "Implementation Phase",
                        "StartDate"         : "2021-11-01T08:00",
                        "EndDate"           : "2021-11-01T12:00",
                        "leaf"              : true,
                        "Rollup"            : true
                    }
                ]
            }
        ]
    }
}
Снимок экрана 2021-10-08 103135.png
Снимок экрана 2021-10-08 103135.png (30.67 KiB) Viewed 731 times

Could you please provide a runnable test case (or dataset for advanced demo) that would clearly show your problem? Data, steps, expected and received result.


Post by friedj »

Hello again,

Thanks for this very helpful example.
You set the HoursPerDay to 4 for the NightShift calendar which is assigned to Resource 2.
When setting the duration for task Implementation Phase to 1 day I would expect to end at: 2021-11-01T12:00 and NOT at 2021-11-02T12:00, because for Resource 2 the duration of one day means 4 hours.
Based on your example the HoursPerDay set for NightShift calendar is simply neglected.

The same problem from a different angle:
In case of task Implementation Phase you set the following data in model:
"StartDate": "2021-11-01T08:00",
"EndDate": "2021-11-01T12:00",
=> In this case what is the calculated duration of this task? We expect 1 day because the assigned calendar HoursPerDay config is 4.


Post by Maxim Gorkovsky »

When setting the duration for task Implementation Phase to 1 day I would expect to end at: 2021-11-01T12:00 and NOT at 2021-11-02T12:00, because for Resource 2 the duration of one day means 4 hours.

As I said above, task duration is always expressed according to the project calendar. Please refer to this guide it explains concept in more details: https://bryntum.com/docs/gantt-for-extjs/#!/guide/gantt_calendars

In this case what is the calculated duration of this task? We expect 1 day because the assigned calendar HoursPerDay config is 4.

1 day is 8 hours. Task duration is 4 hours, so gantt will show its duration as 0.5 days.

There is a private flag which is meant to do what you're asking for here but it would only work if you set calendar on task model: https://bryntum.com/docs/gantt-for-extjs/#!/api/Gnt.model.Task-property-useOwnCalendarAsConverter Resource calendar would be ignored


Post by friedj »

Hello again!

This flag works thank you very much!
Could you tell what would be the procedure in case of Scheduler to achieve the same thing?
In Scheduler right now I use the availableStore property of Sch.panel.SchedulerGrid class in order to load the calendar.
Do you have any hint to me? Thank you!


Post by Maxim Gorkovsky »

In Scheduler right now I use the availableStore property of Sch.panel.SchedulerGrid class in order to load the calendar.

There is no such config in latest Ext Scheduler. Where did you find it?

Could you tell what would be the procedure in case of Scheduler to achieve the same thing?

How do you mean? Gantt is different from Scheduler in a way that in Gantt every row is a task which has a duration, but in Scheduler every row is a resource, and resource doesn't have duration. What do you want to see in Scheduler? Please elaborate.


Post Reply