PushState
The PushState is a state in a state machine that automatically pushes projects to the next state without manual intervention.
Potential use cases are:
- Transitional states between manual workflow steps
- Time-based or condition-based automatic progression
- States that serve as checkpoints but do not require user interaction
The push_projects() method pushes all projects within the state to the next one.
Events are triggered with the comment “Auto-Push” and attributed to PERSEUS, indicating this was an automated system process.
Example
Section titled “Example”To regularly move projects from a PushState to the next state you can add a cronjob in the initialize() method.
The following PushState example pushes all projects in this state to the next state every 2 minutes.
from perseus.utils import add_cronjob
from ..PushState import PushState
class CustomPushState(PushState): @classmethod def initialize(cls): add_cronjob( CustomPushState.push_projects, "*/2 * * * *", f"{CustomPushState.__name__} push_projects", )