FEEL Expression in BRE

Hi,
Using Feel expression I need to parse this DMN input field for discount code is the type and the discount reason is the reason for input JSON

Input JSON:
{
“adjustments”: [
{
“amount”: 10,
“percent”: null,
“reason”: “Internal Usage”,
“type”: “INTERNAL_USE”
}
]
}

Output JSON:

{
“adjustments”: [
{
“discountType”: “MANUAL”
}
]
}

Hi @mayur,

what is your current problem?

What did you try so far?

Best regards,
Philipp

Hi, @Philipp_Ossler I am generating output as a BPMN workflow but the problem is that I don’t wanna use BPMN workflow in order to have output as shown above. Instead, I want something which will help me to generate suggested output by DMN itself, Input and output have been given on post. Does Feel expression will help me to get the output as I am expecting? if yes what will be approach?

That should be possible.

The JSON input seems to contain a list of adjustments. So, you may need a list operation to check if it contains the values.

The JSON output should be created by a context expression. For example:

{adjustments: [ { discountType: “MANUAL” } ] }

Does this help you?