Package org.aperteworkflow.scripting

Examples of org.aperteworkflow.scripting.ScriptProcessorRegistry


            if (!hasText(getScriptEngineType()) || !hasText(getScriptSourceCode()) && !hasText(getScriptExternalUrl()))
                return executed;
            Map<String, Object> fields = getFieldsMap(widgetsDefinitionElement.getWidgets());
            fields.put("process", processInstance);

            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);
View Full Code Here


            commit();
            return;
        }

        try {
            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 URL((String) url.getValue()).openStream();
            scriptProcessor.validate(is);
            url.commit();
View Full Code Here

        if (code.getValue() == null || ((String) code.getValue()).trim().isEmpty()) {
            commit();
            return;
        }
        try {
            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());
View Full Code Here

public class ScriptingEnginesComboBox extends CustomComboBoxField {


    @Override
    protected Container getValues() {
        ScriptProcessorRegistry registry =  ProcessToolContext.Util.getThreadProcessToolContext().getRegistry()
                .lookupService(
                ScriptProcessorRegistry.class.getName());
        Collection<String> registeredProcessors = registry.getRegisteredProcessors();

        return new BeanItemContainer<String>(String.class, registeredProcessors);
    }
View Full Code Here

TOP

Related Classes of org.aperteworkflow.scripting.ScriptProcessorRegistry

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.