Comment 1 for bug 1809257

Revision history for this message
Michal Špondr (micaai) wrote :

This is also suspicious to me:

        state_space = [
                {
                    'name': '0',
                    'next_states': {
                        'STA': '1'
                    },
                    'on_exit': builder.on_exit_0,
                    'on_enter': builder.on_enter_0
                },
                {
                    'name': '1',
                    'next_states': {
                        'STP:REDY': '0',
                        'STP:!REDY': '0'
                    },
                },
        ]

        # build and initialize the automaton now
        self.machine = machines.FiniteMachine.build(state_space)
        self.machine.default_start_state = '0'
        self.machine.initialize()

I've tried to add on_enter method and for that I've got this automaton:

+-------+-----------+-----+------------------------------------------------------------+-----------------------------------------------------------+
| Start | Event | End | On Enter | On Exit |
+-------+-----------+-----+------------------------------------------------------------+-----------------------------------------------------------+
| @0[^] | STA | 1 | . | bam_processor.modules.batch_module.BatchBuilder.on_exit_0 |
| 1 | STP:!REDY | 0 | bam_processor.modules.batch_module.BatchBuilder.on_enter_0 | . |
| 1 | STP:REDY | 0 | bam_processor.modules.batch_module.BatchBuilder.on_enter_0 | . |
+-------+-----------+-----+------------------------------------------------------------+-----------------------------------------------------------+

As you can see there are on_enter_0 callbacks at On Enter in state '1' while I defined it for state '0'.