{"id":20492485,"url":"https://github.com/mumez/sstate","last_synced_at":"2026-03-14T19:37:37.669Z","repository":{"id":147003597,"uuid":"267601114","full_name":"mumez/SState","owner":"mumez","description":"A simple Finite State Machine for Smalltalk","archived":false,"fork":false,"pushed_at":"2022-01-21T05:18:33.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T05:54:54.238Z","etag":null,"topics":["fsm","pharo","smalltalk"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mumez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-28T13:44:20.000Z","updated_at":"2022-01-21T05:18:36.000Z","dependencies_parsed_at":"2023-04-28T09:44:31.508Z","dependency_job_id":null,"html_url":"https://github.com/mumez/SState","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSState","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSState/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSState/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSState/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mumez","download_url":"https://codeload.github.com/mumez/SState/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242073337,"owners_count":20067812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fsm","pharo","smalltalk"],"created_at":"2024-11-15T17:29:17.723Z","updated_at":"2026-03-14T19:37:32.607Z","avatar_url":"https://github.com/mumez.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SState\n\n[![smalltalkCI](https://github.com/mumez/SState/actions/workflows/main.yml/badge.svg)](https://github.com/mumez/SState/actions/workflows/main.yml)\n\nA simple Finite State Machine for Smalltalk\n\n## Features\n\nSState is a fairly simple FSM implementation, but is functional:\n\n- You can add entry-action, exit-action and activity to State object.\n- You can set transition action to Transition object.\n- Supports guarded transition, auto transition, and decision.\n- Hierarchical state machine support.\n- StateMachine can handle both symbol and event object with possible arguments.\n\n## Installation\n\n```smalltalk\nMetacello new\n  baseline: 'SState';\n  repository: 'github://mumez/SState/src';\n  load.\n```\n\n## Example\n\n```smalltalk\nstateMachine := SsStateMachine new.\n\nstateA := (stateMachine addStateNamed: #stateA)\n    entryAction:[Transcript cr; show: 'entry stateA' ];\n    exitAction:[Transcript cr; show: 'exit stateA' ];\n    when: #toB to: #stateB;\n    when: #toC to: #stateC.\n\nstateB := (stateMachine addStateNamed: #stateB)\n    when: #toA do: [Transcript cr; show: 'b-\u003ea'] to: #stateA.\n\nstateC := (stateMachine addStateNamed: #stateC)\n    when: #toA do: [Transcript cr; show: 'c-\u003ea'] to: #stateA;\n    endWhen: #end.\n\nstateMachine setStartStateTo: #stateA. \"stateA entry-action fired\"\n\nstateMachine handleEvent: #toB. \"stateA exit-action fired\"\nstateMachine handleEvent: #toA. \"b-\u003ea transition action and stateA entry-action fired\"\nstateMachine handleEvent: #toC. \"stateA exit-action fired\"\nstateMachine handleEvent: #bom. \"Non-supposed events are ignored\"\n[stateMachine handleEvent: #boo] on: SsEventNotSupposed do: [:ex | ex inspect]. \"But you can catch it if you like\"\nstateMachine handleEvent: #end.\nstateMachine atEnd. \"true\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2Fsstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmumez%2Fsstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2Fsstate/lists"}