pytransitions / transitions

A lightweight, object-oriented finite state machine implementation in Python with many extensions
MIT License
5.5k stars 525 forks source link

Model state tree does serialize nested parallel states only when they are the first child. #412

Closed aleneum closed 4 years ago

aleneum commented 4 years ago
tree = {
    'P': {
        '1': {},
        '2': {
            'a': {},
            'b': {
                'x': {
                    '1': {},
                    '2': {}
                },
                'y': {}
            }
        }
    }
}

Expected:

['P_1', ['P_2_a', [['P_2_b_x_1', 'P_2_b_x_2'], 'P_2_b_y']]]

Actual

'P_1'