Questions tagged [pytransitions]

Transitions is a lightweight, object-oriented state machine implementation in Python with many extensions.

Transitions is a flexible state machine library compatible with Python 2.7+ and Python 3+. It features extensions such as hierarchical/nested states, state diagrams, state decorators (e.g. Error states or Timeouts), thread-safe and asynchronous machines.

Resources

49 questions
1
vote
2 answers

Python transitions library - calling transition from inside callbacks

I'm using transitions library for Python and I'm finding it really useful. In my specific case I'm using FSMs that make decisions inside the states (in callbacks) and accordingly to an internal logic call new transitions. For instance: states =…
1
vote
1 answer

Pytransitions queued hierarchical machine ends always in init state

I'm using the pytransitions with HierarchicalMachine class to be able to create small nested machines to complete subtasks inside a bigger state machine. I'm using the queued transitions to be able to invoke a trigger from inside of the state…
Jan Krejci
  • 85
  • 8
1
vote
2 answers

Terminal/sink state in pytransitions

I am using pytransitions with a state machine for example from transitions import Machine from transitions import EventData class Matter(object): def __init__(self): transitions = [ {'trigger': 'heat', 'source': 'solid',…
Gulzar
  • 23,452
  • 27
  • 113
  • 201
1
vote
1 answer

State history in Pytransitions

I am using Pytransitions and I have some state machine, for example from transitions import Machine from transitions import EventData class Matter(object): def __init__(self): transitions = [ {'trigger': 'heat', 'source':…
Gulzar
  • 23,452
  • 27
  • 113
  • 201
1
vote
2 answers

Pytransitions: AsyncMachine Sequential Resolution of Asynchronous Dependent Callbacks

Note: This question is related to Python's FSM library pytransitions I'm looking for a way to resolve method callbacks sequentially when they've been mentioned as a list in prepare or/and before or/and after. I'm using AsyncMachine module from…
Saurav Kumar
  • 563
  • 1
  • 6
  • 13
1
vote
1 answer

HierarchicalGraphMachine hiding nested states

I've been experimenting with the HierarchicalGraphMachine class to help visualise the machine structures as I edit them. from transitions.extensions import HierarchicalGraphMachine as Machine count_states = ['1', '2', '3', 'done'] count_trans = [ …
Bilby42
  • 11
  • 1
1
vote
1 answer

pytransitions, timeout, in-memory, persisting to database

Question regarding the pyTransitions package, which I am currently using in one of my projects. I have tested in the very beginning when evaluating different packages, among others also the timeout functionality which l knew I would need somewhere…
Joel Thill
  • 25
  • 4
1
vote
1 answer

pyTransitions trigger() method blocks

I have a fairly complex application involving a GUI front-end and several other classes, several of which are state machines based on the excellent pytransitions library. The application hangs at various times, and being multi-threaded it is…
banjaxed
  • 243
  • 1
  • 6
1
vote
1 answer

Nested Child FSM prevent parent transitions when in certain states

I am using pytransitions to create a hierarchical state machine with a number of nested child FSMs. When a child FSM enters a critical state, I want to suppress transitions on the parent(s) until such time that the child has completed it's activity.…
S1MP50N
  • 11
  • 1
  • 2
1
vote
1 answer

How to pass event parameters in condition function in pytransition

I am trying to pass a parameter to conditions. But it was giving the following error code: from transitions import Machine class evenodd(object): def get_no(self, event): self.no = event.kwargs.get('no', 0) def calc_mod(self,…
Sreeja
  • 53
  • 1
  • 3
1
vote
1 answer

Using PyTransitions State Machine to force a callback during State Machine intialization

I have written a state machine for a pool controller, but I am struggling with something that is noted in the documentation about forcing the on_enter method to fire off when I initialize the model. The documentation says: "Note that…
1
vote
1 answer

Use DMXPY with a Transitions state machine

I am trying to use DmxPy with a state machine written in Transitions but trying to pass the DmxPy to the finite state machine is throwing a metaclass error. It seems output of DmxPy is a Nonetype which is not running within the Transitions state…
1
vote
1 answer

Telebot + Celery + pytransitions: response to task

I want to send some message after time delay, using Celery. After users get message, its trigger new state. For this I need telebot.types.Message object to be send as argument in Celery task. How can I do this correctly? My transition function to…
Kate Gurman
  • 73
  • 1
  • 8
1
vote
1 answer

How to properly combine PySide2 and pytransitions for implementing a state machine for GUI application

Background: I'd like to implement a GUI for controlling a bunch of clients (that talk to 'servers' controlling hardware like motors, cameras etc. via RPC calls) using PySide2. Previous approach: Typically, what I'd do is to create my GUI and connect…
Julian S.
  • 440
  • 4
  • 14
1
vote
1 answer

Nesting in Pytransitions

I have been looking at closed issues on github, SO, and googling to solve this issue. But I haven't been able to solve my problem and this seems to be the right place. I already opened an issue on github, but I am not sure if that was the right…
Keivan
  • 673
  • 7
  • 15