Skip to content

createStaticInputMap()

type createStaticInputMap = (
inputData: DecisionInputBase[],
validator?: DecisionValidator,
) => StaticInputMap;

Return value

Returns a StaticInputMap that can be used to retrieve decision inputs and validation errors.

Params

inputData: DecisionInputBase[]

An array of decision inputs.

validator: DecisionValidator

An optional validator.

If no validator is provided, data is assumed to be valid. This is useful in scenarios where the data is guaranteed to have been validated in a different process.

Usage

const validator = createDecisionValidator(schemaMap);
const inputData = await loadDecisionsFromPaths(dataPaths);
const inputMap = createStaticInputMap(inputData, validator);