Package com.baasbox.service.scripting.base

Examples of com.baasbox.service.scripting.base.ScriptResult


            return notFound("Script does not exists");
        }
        JsonNode reqAsJson = serializeRequest(path, request());

        try {
            ScriptResult result =ScriptingService.invoke(ScriptCall.rest(serv, reqAsJson));
            return status(result.status(),result.content());
        } catch (ScriptEvalException e) {
            Logger.error("Error evaluating script",e);
            return internalServerError("script failure "+ ExceptionUtils.getFullStackTrace(e));
        }
//        catch (IllegalStateException e){
View Full Code Here


        if (result == null){
            return ScriptResult.NULL;
        } else if (result instanceof Boolean){
            return (Boolean) result ?ScriptResult.TRUE:ScriptResult.FALSE;
        } else if (result instanceof String){
            return new ScriptResult((String)result);
        } else if (result instanceof ScriptObjectMirror){
            JsonNode node = convertDeepJson(result);
            if (node != null){
                return new ScriptResult(node);
            } else {
                return ScriptResult.NULL;
            }
        } else if (result instanceof Number){
            return  new ScriptResult((Number)result);
        } else if (result instanceof Undefined){
            return ScriptResult.NULL;
        } else {

            Logger.warn("Mirror: %s, of type: %s",result,result.getClass());
View Full Code Here

            if (call.event == null) {
                return null;
            }

            Object result = emitEvent(moduleRef, call.event, call.eventData);
            ScriptResult scriptResult = mMapper.convertResult(result);
            call.validate(scriptResult);
            if (Logger.isTraceEnabled())Logger.trace("ScriptResult: %s",scriptResult.toString());
            return scriptResult;
        } catch (Throwable err){
            if (err instanceof NashornException){
                if(Logger.isTraceEnabled())Logger.trace("Error in script");
View Full Code Here

TOP

Related Classes of com.baasbox.service.scripting.base.ScriptResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.