Search in sources :

Example 1 with MangoJavaScriptResultModel

use of com.infiniteautomation.mango.rest.latest.model.javascript.MangoJavaScriptResultModel in project ma-modules-public by infiniteautomation.

the class EventHandlersRestController method validateScript.

private MangoJavaScriptResultModel validateScript(MangoJavaScriptModel model, String noChangeTranslationKey) {
    // Set to potentially return a String
    model.setResultDataType(DataType.NUMERIC.name());
    MangoJavaScript jsVo = model.toVO();
    jsVo.setWrapInFunction(true);
    return new MangoJavaScriptResultModel(javaScriptService.testScript(jsVo, noChangeTranslationKey));
}
Also used : MangoJavaScriptResultModel(com.infiniteautomation.mango.rest.latest.model.javascript.MangoJavaScriptResultModel) MangoJavaScript(com.infiniteautomation.mango.util.script.MangoJavaScript)

Aggregations

MangoJavaScriptResultModel (com.infiniteautomation.mango.rest.latest.model.javascript.MangoJavaScriptResultModel)1 MangoJavaScript (com.infiniteautomation.mango.util.script.MangoJavaScript)1