When updating a model from version 21.0 to 21.2, we noticed that the state gantt chart template does not work with "BasicFR" objects.
A similar bug apparently existed and got fixed before, but was seemingly reintroduced when the state gantt chart got updated in the latest version.
https://answers.flexsim.com/questions/52727/state-gantt-template-does-not-work.html
It is caused by the templates statistics collector not taking into account the differences in parameters of the "On State Change" event between the "BasicFR" and other objects.
Similar to the old bug, it can be fixed by installing the chart components and manually adjusting the events in the statistics collector to properly assign the values.
In addition, the line
int profileNum = data.profile ? data.profile.rank : 0;
should (probably?) be replaced with just (when using multiple profiles)
int profileNum = data.profile;
, as the profile is returned already returned as an integer by the BasicFR-event.
Example model with both broken and fixed chart: