Flow InheritanceΒΆ

Inherit from a flow class to add or override transitions.

Use State.super() to wrap the parent method while keeping its state changes. Access the unwrapped parent method with .original:

class MyFlow(object):
    state_field = fsm.State(States, default=States.NEW)

    @state_field.transition(source=States.DONE, target=States.HIDDEN)
    def hide():
        print('base hide')

class GuestFlow(MyFlow):
    @MyFlow.state_field.super()
    def hide(self):
        # Additional code before calling parent
        super().hide.original()