Evaluate DMN with input that might not match the DMN expected input

Out of curiosity, any feedback on my approach to using DMN to evaluate spreadsheet values that might not directly match 1:1?
(e.g. if there is anything from community that can help me with getting input of DMN and any parts of the process or bring it this to next level)

(This feels a bit medieval if I take step back end think about general testability and DMN lifecycle between business users, spreadsheets…)

I have input from excel that I want to use to evaluate DMN.

Challenges:

  • column names might have whitespaces, be in different casing format or have some +/? at the end…

I can’t just call DMN passing those columnName:value key pairs, so need to check what inputs DMN have and fuzzy match them with excel.

Here is my approach:

  1. Create API to retrieve all input fields of DMN. That api should generate template that I need to fill on client side and then pass to the /evaluate api as payload,
{
	"variables": {
		"Country" : {
			"value": "<<Country>>", "type": "String"
		},
	}
}
  1. Rest API will return above template, now on the other side I will do the used to fuzzy match,
    a) find all tokens << >>
    b) fuzzy match tokens with available values
    c) replace tokens in the template

  2. Call /evaluate
    e.g.

{
	"variables": {
		"Country" : {
			"value": "USA", "type": "String"
		},
	}
}