Package org.aperteworkflow.scripting

Examples of org.aperteworkflow.scripting.ScriptProcessor


            ScriptProcessorRegistry registry = ProcessToolContext.Util.getThreadProcessToolContext().getRegistry().lookupService(
                    ScriptProcessorRegistry.class.getName());
//          TODO: some smart cacheing
            InputStream is = loadScriptCode();
            ScriptProcessor scriptProcessor = registry.getScriptProcessor(getScriptEngineType());
            if (scriptProcessor == null) {
                logger.severe("Script processor not found: " + getScriptEngineType() + ", skipping script execution. ");
                return executed;
            }
            scriptProcessor.process(fields, is);
            executed = true;
            boundProperties.clear();
         //   dictContainers.clear();

        } catch (Exception e) {
View Full Code Here


                    ScriptProcessorRegistry.class.getName());
            Property scriptType = formProperties.get("scriptEngineType");

            if (scriptType == null || scriptType.getValue() == null || ((String) scriptType.getValue()).isEmpty())
                throw new Validator.InvalidValueException("script.undefined.type");
            ScriptProcessor scriptProcessor = registry.getScriptProcessor((String) scriptType.getValue());
            if (scriptProcessor == null)
                throw new Validator.InvalidValueException("script.processor.not.found");
            InputStream is = new URL((String) url.getValue()).openStream();
            scriptProcessor.validate(is);
            url.commit();
            showInfoNotification("validation.script.ok");

        } catch (Validator.InvalidValueException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

            ScriptProcessorRegistry registry = ProcessToolContext.Util.getThreadProcessToolContext().getRegistry().lookupService(
                    ScriptProcessorRegistry.class.getName());
            Property scriptType = formProperties.get("scriptEngineType");
            if (scriptType == null || scriptType.getValue() == null || ((String) scriptType.getValue()).isEmpty())
                throw new Validator.InvalidValueException("script.undefined.type");
            ScriptProcessor scriptProcessor = registry.getScriptProcessor((String) scriptType.getValue());
            if (scriptProcessor == null)
                throw new Validator.InvalidValueException("script.processor.not.found");

            InputStream is = new ByteArrayInputStream(((String) code.getValue()).getBytes());

            scriptProcessor.validate(is);
            code.commit();
            showInfoNotification("validation.script.ok");
        } catch (Validator.InvalidValueException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
            showWarningNotification(e.getMessage(), null);
View Full Code Here

TOP

Related Classes of org.aperteworkflow.scripting.ScriptProcessor

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.