Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seneca state machine plugin sample

Seneca

Sample that demonstrates the usage of seneca state machine.

Beside changing states the sample also demonstrates event generation, a save command is issued after each state change.

                                                       [review()]
                                                ----<--------<-----<----
      [create()]               [review()]       |       [approve()]     |         [schedule()]
CREATE---------->TRIAGE_CONTENT---------->REVIEW_CONTENT---------->CONTENT_APPROVED----------->CONTENT_SCHEDULED

The states are configured in the smconfig.js. There are 5 states defined: CREATE, TRIAGE_CONTENT, REVIEW_CONTENT, CONTENT_APPROVED, CONTENT_SCHEDULED. For each state a command to change state is defined.

After each state change an after hook is defined, this hook executes the role: content, context: document, cmd: save seneca action.

How to run

node index.js

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages