getEvaluatedFormElement

API / @publicodes/forms / getEvaluatedFormElement

function getEvaluatedFormElement<Name>(
   engine, 
   dottedName, 
options?): EvaluatedFormElement<Name>

Defined in: evaluatedFormElement.ts:123

Get the form element for a publicodes rules enriched with runtime information from the engine.

The evaluated form element includes additional properties:

  • applicable: whether the element should be displayed
  • required: whether the element is mandatory
  • answered: whether the element has a value in the current situation
  • value/checked: the current value of the element
  • defaultValue/defaultChecked: the default value of the element
  • unit: for number inputs, the unit of measurement
  • options: for radio groups and select elements, the list of options with applicability

see EvaluatedFormElement

Type Parameters

Type ParameterDescription
Name extends stringThe type of the dotted name string

Parameters

ParameterTypeDescription
engineEngine<Name>The publicodes engine instance
dottedNameNameThe dotted name identifier of the rule to evaluate
options?FormElementOptions-

Returns

EvaluatedFormElement<Name>

The evaluated form element with additional runtime properties

Throws

Implicitly throws if the engine operations fail