Our state of the art Gantt chart


Post by yklein »

We currently are trying to use Bryntum's scheduler Pro library with Gantt but have use cases where events outside of the Gantt UI will need to trigger scheduling of milestones / tasks. For example an update to some backend Data will then cause a re-scheduling to occur.

We would like to leverage schedule pro for this and are wondering what a good starting point is, these operations would also need to occur in bulk. Is there anything documented anywhere that could help? I see that Salesforce is a supported platform, what are the best practices for implementing this type of use case?


Post by Maxim Gorkovsky »

Hello.

We currently are trying to use Bryntum's scheduler Pro library with Gantt
We would like to leverage schedule pro for this

Could you please clarify this one? In our demos we do show how to integrate scheduler pro with gantt, but the only supported way is to use gantt project in scheduler pro, not vice versa.

I see that Salesforce is a supported platform, what are the best practices for implementing this type of use case?

We just recently began supporting Salesforce platform, so we don't have many best practices figured out. So far there is a known performance issue and a workaround: https://github.com/bryntum/support/issues/1899

For example an update to some backend Data will then cause a re-scheduling to occur.

If I understand you correctly, you can listen to backend data changes, and when they occur you just apply same changes to the project data. We do not have API to apply a changeset to the project data, so there are few options here:

  1. Override a transport layer to handle load/sync requests. See these doc articles for more info:
    https://bryntum.com/docs/gantt/#Scheduler/data/CrudManager
    https://bryntum.com/docs/gantt/#Scheduler/crud/transport/AjaxTransport
  2. Load inline data with: https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#function-loadCrudManagerData
  3. Iterate individual records and apply changes. When you change the record we schedule a project recalculation in the next microtask, so if you apply all the changes at once performance shouldn't be a problem.

Post by yklein »

Hello Maxim, let me start by saying thanks for replying!

I apologize for any confusion my post may have caused. We are using SchedulerPro + Gantt together as is intended. My questions were more geared towards also wanting to leverage SchedulerPro's engine outside of the Gantt UI.

For example: In salesforce's ecosystem you have several possible entry points into the execution of business logic. A user interacting with a UI is certainly one of these entry points (someone dragging or creating a task/milestone on the Gantt for example), for this use case we understand what we need to do to get everything working.

What we would like to do as well is leverage the Scheduling engine when a database operation occurs due to either a database trigger or some other backend logic (like a java class executing on the server that causes fields to update which should cause re-scheduling of tasks). Basically our challenge is in the communication between our database trigger or backend code and the Chronograph / Scheduling Engine code, specifically for Salesforce environments. I understand that Chronograph is isomorphic and can be used on a Node server. Apologies in advance if this is clearly documented somewhere but would you be able to point me in the direction of an example implementation of this? It would not be optimal for us to have to make callouts to a node server from our backend due to performance and data integrity concerns but it would at least give me an idea of what is possible as far as hosting the scheduling engine on a backend.

Additionally, we have a use case that requires us to be able to make updates in bulk and execute scheduling on a number of projects at once. Is the Scheduling engine designed to be able to handle bulk updates and rescheduling of 20-50 projects in a single transaction?

Thank you so much for any help you can provide


Post by Maxim Gorkovsky »

Hello.

Apologies in advance if this is clearly documented somewhere but would you be able to point me in the direction of
an example implementation of this?

We do not have this documented anywhere yet, neither we have demos. However there are some success stories from users, please refer to this post: viewtopic.php?f=52&t=13714&hilit=node+engine&start=10
Long story short, you can run engine on the backend but you will have to implement all the syncing logic on your own. We do not have that out of the box yet. Another problem is that Gantt always has own engine and will always recalculate values. But given engines and data are identical, project schedule should be identical too. We have a ticket to support that: https://github.com/bryntum/support/issues/2284

Additionally, we have a use case that requires us to be able to make updates in bulk and execute scheduling on a number of projects at once.

Bulking is what engine does internally by using async execution. For instance, when you change field which affects scheduling it works smth like this:

// pseudo code
setStartDate(value) {
  this._value = value;
  this.project.commitAsync()
}

Calling commitAsync would schedule a project recalculation. So if you prepare all the changes and apply them to records within a single synchronous task, engine will recalculate itself in the following microtask. Engine will not recalculate itself synchronously on a record change.

Is the Scheduling engine designed to be able to handle bulk updates and rescheduling of 20-50 projects in a single transaction?

Engine is supposed to handle single project, i.e. engine classes are mixed into the model classes and the only entry point is the ProjectModel.
You can try to bring abstaction to another level by having multiple different projects inside a single ProjectModel, acting like a top-level tasks. Assuming you will run this on the backend, only limitation that I can see would be the project calendar - all projects inside a single ProjectModel would share project calendar. If base calendar is identical for all the nodes you shouldn't have any problems.

Basically our challenge is in the communication between our database trigger or backend code and the Chronograph / Scheduling Engine code, specifically for Salesforce environments

You'll have to implement this layer on your own. Gantt in a client application can load data inline or from the URL via a transport layer. It cannot monitor the backend, so if data on the backend changes you'll have to somehow trigger Gantt to load new data. Either inline or from the URL. Or, if you implement own transport layer - from anywhere you want.

I hope this helps. If you have further questions don't hesitate to ask.


Post by yklein »

Thanks for the reply Maxim.

Engine is supposed to handle single project, i.e. engine classes are mixed into the model classes and the only entry point is the ProjectModel.
You can try to bring abstaction to another level by having multiple different projects inside a single ProjectModel, acting like a top-level tasks. Assuming you will run this on the backend, only limitation that I can see would be the project calendar - all projects inside a single ProjectModel would share project calendar. If base calendar is identical for all the nodes you shouldn't have any problems.

Regarding the above, if I understand this correctly we would need to extend the Project Model with our custom class that would leverage an array (or similar data structure) containing multiple Projects rather than the one, in essence it would be a collection of ProjectModel instances?

Further regarding the Object Model patterns implemented in your codebase - How possible (and realistic) is it for us to create new Models that extend some of your base classes to introduce additional objects we need without completely bricking the existing engine? Have you had any cases of this being done?

Another problem is that Gantt always has own engine and will always recalculate values. But given engines and data are identical, project schedule should be identical too

Would you be able to elaborate on this a bit further? If we are to move forward with Bryntum we will most certainly need to implement a backend solution for the scheduling engine so any additional information would be very much appreciated


Post by Maxim Gorkovsky »

Regarding the above, if I understand this correctly we would need to extend the Project Model with our custom class that would leverage an array (or similar data structure) containing multiple Projects rather than the one, in essence it would be a collection of ProjectModel instances?

I meant that you can try using data structure like this:

{
  project : { calendar : 'sharedProjectCalendar' },
  tasks: {
    rows : [
      { id : 'Project 1', children : [...tasks in project 1] },
      { id : 'Project 2', children : [...tasks in project 2] }
    ]
  }
}

So, a regular project which emulates multiple projects with task branches that are not connected between each other, i.e. tasks inside project 1 have no dependencies to tasks in project 2.

Further regarding the Object Model patterns implemented in your codebase - How possible (and realistic) is it for us to create new Models that extend some of your base classes to introduce additional objects we need without completely bricking the existing engine? Have you had any cases of this being done?

You can extend default models, add fields, change behavior of existing fields, even change calculation logic by overriding certain methods. For instance, like in this post: viewtopic.php?p=90194#p90194 That method changes scheduler pro behavior to layout events only in working time as defined by combined calendar.

What objects do you plan to add?

Would you be able to elaborate on this a bit further? If we are to move forward with Bryntum we will most certainly need to implement a backend solution for the scheduling engine so any additional information would be very much appreciated

I am not sure what exactly to elaborate on, but I can try. Let's say you have a project running on the backend and you implemented a way to serve data from that project to the client side. When Gantt receives this data, it will use own project (Gantt always has a project) to recalculate the data. But since both project instances use the same engine (assuming component version is the same), result should be identical - i.e. it is idempotent.


Post by yklein »

Hi Maxim,

I see here https://github.com/bryntum/support/issues/2284 that there is an open ticket for supporting the disabling of scheduling engine in the event that we want to use our own backend. Can you give me a timeline as to when this is expected to be delivered?

Are there any workarounds we can implement on our end to mimic this functionality while we wait for the official release if we want to move forward with Gantt on our frontend?

Thanks in advance!


Post by mats »

This is something we aim to address in Q3/Q4, if you have budget we are open to accepting sponsorship for delivering it sooner.


Post by yklein »

Are there any workaround we can implement from a code perspective that can get us a similar result in the short term while we wait for you guys to release this functionality?


Post by Maxim Gorkovsky »

Well, you will have to feed the data to the project and project will recalculate it. There is no way around. Also project should be fast enough, especially with pre-calculated data


Post Reply