variables

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package variables provides the Vars type for passing values to and from the QuantumBPM DMN engine and BPMN runtime.

Vars is a thin map[string]any with helpers for typed access and for converting to/from the wire types used by the generated client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T any](v Vars) (T, error)

As decodes the entire Vars into a value of type T using a JSON round-trip. Use it for opt-in typed handlers in the workers package.

func Get

func Get[T any](v Vars, name string) (T, error)

Get decodes the value at name into T using a JSON round-trip. The round-trip normalizes numeric types and nested structures, so callers can pass Go structs, slices, or maps as T.

Types

type Vars

type Vars map[string]any

Vars holds a set of named variables. The same type is used for DMN evaluation contexts, BPMN process variables, and external job payloads.

func From

func From(m map[string]any) Vars

From copies a map into a new Vars.

func FromFeelContext

func FromFeelContext(fctx generated.FeelContext) (Vars, error)

FromFeelContext lifts a FeelContext into a Vars value.

func FromWireMap

func FromWireMap(m *generated.VariableMap) Vars

FromWireMap copies a *generated.VariableMap (typical generated BPMN response shape) into a Vars. Numbers arrive as json.Number - exact decimals survive the read path.

func New

func New() Vars

New returns an empty Vars.

func (Vars) Lookup

func (v Vars) Lookup(name string) (any, bool)

Lookup returns the raw value at name and whether it was present.

func (Vars) Set

func (v Vars) Set(name string, value any) Vars

Set assigns name=value and returns the same Vars for chaining.

func (Vars) ToFeelContext

func (v Vars) ToFeelContext() (generated.FeelContext, error)

ToFeelContext converts the Vars to a FeelContext for DMN evaluation. The conversion is a JSON round-trip, which faithfully preserves nested structures while letting the FEEL engine impose its type rules on receipt.

func (Vars) ToWireMap

func (v Vars) ToWireMap() *generated.VariableMap

ToWireMap returns the Vars as the *generated.VariableMap shape the generated BPMN endpoints accept. Returns nil for an empty/nil Vars so that the optional field can be omitted from the request body.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL