private function createStepsNodeDefinition()
    {
        $stepsNode = new ArrayNodeDefinition('steps');

        $stepsNode
            ->defaultValue(array())
            ->useAttributeAsKey('name')
            ->prototype('array')
                ->addDefaultsIfNotSet()
                ->children()
                    ->scalarNode('label')
                        ->defaultValue('')
                    ->end()

                    ->arrayNode('roles')
                        ->prototype('scalar')->end()
                    ->end()

                    ->arrayNode('model_status')
                        ->validate()
                            ->ifTrue(function ($value) {
                                return (is_array($value) && count($value) < 2);
                            })
                            ->thenInvalid('You must specify an array with [ method, constant ]')
                            ->ifTrue(function ($value) {
                                return ( ! defined($value[1]));
                            })
                            ->thenInvalid('You must specify a valid constant name as second parameter')
                        ->end()
                        ->prototype('scalar')->end()
                    ->end()

                    ->scalarNode('on_invalid')
                        ->defaultNull()
                    ->end()
                ->end()
                ->append($this->createNextStatesNodeDefinition())
            ->end()
        ;

        return $stepsNode;
    }