getEvaluatedFormElement
API / @publicodes/forms / getEvaluatedFormElement
function getEvaluatedFormElement<Name>(engine, dottedName): EvaluatedFormElement
Defined in: evaluatedFormElement.ts:114
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
Type Parameters
Type Parameter | Description |
---|---|
Name extends string | The type of the dotted name string |
Parameters
Parameter | Type | Description |
---|---|---|
engine | Engine <Name > | The publicodes engine instance |
dottedName | Name | The dotted name identifier of the rule to evaluate |
Returns
The evaluated form element with additional runtime properties
Throws
Implicitly throws if the engine operations fail