question

tdmasure avatar image
0 Likes"
tdmasure asked Matthew Gillespie commented

Exceptions when using default State Gantt chart template with BasicTE

The built-in state gantt chart does not work with the BasicTE library object. State is not updated correctly and exceptions are thrown when the update should happen. Exception is only happening with BasicTE, not with other TaskExecuter objects.

Project below demonstrates the problem.

BasicTE_StateGanttChart.fsm

Image below shows the exceptions during simulation run and that the state gantt is not updated.

screenshot-2023-03-30-173937.png

FlexSim 22.2.4
buggantt chartbasicte
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
@Tdmasure ,a Basic Taskexecuter is an object stripped of almost every typical automated features of a standard object. You have to build most features yourself. If you experience some errors, then it is because there are missing data values a standard object automatically creates.
0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Matthew Gillespie commented

This is a bug, thank you for reporting it.

Until the bug is fixed, here is a workaround:

  1. Install the chart (on the Advanced panel in Properties)
  2. Open the properties for the Statistics Collector that appears in the Toolbox
  3. Edit the code for the BasicFR State Change Finish and Start events:
    /**Custom Code*/
    StatisticsCollector collector = ownerobject(c);
    treenode listenTo = param(1);
    Array objects = collector.Objects.as(Group).toFlatArray();
    Array result;
    for (int i = 1; i <= objects.length; i++)
        if (isclasstype(objects[i],"BasicFR") || isclasstype(objects[i], "BasicTE"))
            result.push(objects[i]);
    result.push(-1);
    return result;
  4. Edit the code for the Non BasicFR State Change Finish and Start events:
    /**Custom Code*/
    StatisticsCollector collector = ownerobject(c);
    treenode listenTo = param(1);
    Array objects = collector.Objects.as(Group).toFlatArray();
    Array result;
    for (int i = 1; i <= objects.length; i++)
        if (!isclasstype(objects[i],"BasicFR") && !isclasstype(objects[i], "BasicTE"))
            result.push(objects[i]);
    
    result.push(-1);
    return result;

Here is your model with these changes applied:

basicte-stateganttchart_1.fsm


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Tdmasure This issue is fixed in 23.0.6 released today.

1 Like 1 ·