Skip to content

Extend StatusFlow for hierarchical FSM; add physics and engineering units of measure#720

Open
moqui-industrial wants to merge 1 commit into
moqui:masterfrom
moqui-industrial:feat/statusflow-hsm
Open

Extend StatusFlow for hierarchical FSM; add physics and engineering units of measure#720
moqui-industrial wants to merge 1 commit into
moqui:masterfrom
moqui-industrial:feat/statusflow-hsm

Conversation

@moqui-industrial

Copy link
Copy Markdown

Summary

Two independent additions to the data model:

1. Hierarchical StatusFlow (HSM)

Adds support for nested state machines by extending the StatusFlow entity:

  • StatusFlow.parentStatusFlowId — self-referential FK, allows a flow to be a sub-flow of another
  • StatusFlowStack entity — tracks the active sub-flow stack per record, enabling hierarchical state navigation (enter sub-flow, exit back to parent on completion)
  • StatusFlowTransition PK change: adds toStatusFlowId to support transitions that enter a sub-flow

Useful for complex domain objects (equipment lifecycle, multi-stage orders) where a top-level state contains an independent sub-machine.

2. Physics and engineering units of measure

Extends the UomType and Uom seed data with standard physical and engineering dimensions:

  • Electrical: voltage (V, mV, kV), current (A, mA), resistance (Ω), power (W, kW, MW)
  • Mechanical: torque (N·m), angular velocity (rpm, rad/s)
  • Thermal: thermal resistance (K/W), heat flux (W/m²)
  • Industrial: flow rate (m³/h, L/min), pressure differential

These complement the existing length/mass/time UoMs already in the framework.

StatusFlow gains parentStatusFlowId (recursive FK) enabling nested / hierarchical
state machines (HSM). StatusFlowTransition gains toStatusFlowId PK field for
cross-flow transitions. New StatusFlowStack entity (create-only, cache="never")
tracks the FSM execution stack per entity/pk pair.

NOTE: StatusFlowTransition PK change requires DB migration for existing deployments
with data in STATUS_FLOW_TRANSITION (low risk — configuration data reloaded on startup).

UnitData.xml additions: Acceleration, Jerk, Snap, Angle, Angular Velocity/Acceleration,
Volumetric and Mass Flow, Sound Level, Electrical (charge, capacitance, inductance),
Viscosity, Force, Torque — covering common industrial and IoT measurement types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant