Actions
Typed operations that can be executed on ObjectInstances. Each Action has parameters, preconditions (evaluated before execution), and audit hooks (fired before/after/on failure).
Builder Example
Rust
let set_temp = Action::builder("set_temperature")
.description("Set HVAC target temperature")
.target_type(hvac_type_id)
.parameter(PropertyDef::new("value", PropertyType::F64)
.with_unit("°C")
.with_constraint(PropertyConstraint::Range { min: 16.0, max: 30.0 })
.required())
.precondition(Precondition::PropertyEquals {
property: "mode".into(),
value: PropertyValue::String("cool".into()),
})
.audit_hook(AuditHook::all_fields(AuditEvent::AfterExecution))
.build();
let id = action_registry.register(set_temp)?; Preconditions
| Variant | Description |
|---|---|
| PropertyAbove | Property must exceed threshold |
| PropertyBelow | Property must be below threshold |
| PropertyEquals | Property must equal a specific value |
| TimeWindow | Must be within time range (start_min..end_min) |
| HasInterface | Target must implement an interface |
| And / Or / Not | Composable boolean logic |
Audit Hooks
| Event | When |
|---|---|
| BeforeExecution | Before the action runs (capture pre-state) |
| AfterExecution | After successful execution (capture post-state) |
| OnFailure | On execution failure (capture error context) |
Server-Side Functions
FunctionDef defines typed server-side functions with parameters (Scalar, ObjectSet, Instance, PropertyMap, List) and returns (Scalar, ObjectSet, PropertyMap, Void). Registered in FunctionRegistry and callable via Expr::Call.
Questions?
Reach out for help with integration, deployment, or custom domain codecs.