Finite icon indicating copy to clipboard operation
Finite copied to clipboard

the difference between `-state` and `state`

Open ryuuyq opened this issue 5 years ago • 2 comments

below,there is 'from' => '-proposed' and 'from' => 'proposed'.

what is the difference ?

    'callbacks' => array(
        'before' => array(
            array(
                'from' => '-proposed',
                'do' => function(Finite\StatefulInterface $document, \Finite\Event\TransitionEvent $e) {
                    echo 'Applying transition '.$e->getTransition()->getName(), "\n";
                }
            ),
            array(
                'from' => 'proposed',
                'do' => function() {
                    echo 'Applying transition from proposed state', "\n";
                }
            )
        ),
        'after' => array(
            array(
                'to' => array('accepted'), 'do' => array($document, 'display')
            )
        )
    )

ryuuyq avatar Mar 25 '19 09:03 ryuuyq

image

imzeali avatar Apr 10 '19 01:04 imzeali

Just need some more clarification.

It will apply to all states except that one mentioned? If so how do you add multiple exclusions?

tsmgeek avatar Apr 12 '19 16:04 tsmgeek