Skip to Content
0
Nov 30, 2021 at 06:49 AM

Context in MDK rule editor

457 Views

Hi Experts,

In MDK rule editor the function is using client API(Context). Can you please help to understand what is context which is used in different scenarios?

Example1:

export default function OrderDescription(context) {

let binding = context.getBindingObject();

return ValueIfExists(binding.OrderDescription);

}

Example2:

export default function GetValueFromGlobalVariable(context) {

let appVersion = context.getGlobalDefinition('/MDKTest/Globals/AppDefinition_Version.global');

if (appVersion.getType() == 'string') {

alert(appVersion.getValue());

}

//do something

}

Thanks,

Krishna.