use of org.camunda.bpm.engine.impl.scripting.ScriptFactory in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initScripting.
protected void initScripting() {
if (resolverFactories == null) {
resolverFactories = new ArrayList<ResolverFactory>();
resolverFactories.add(new MocksResolverFactory());
resolverFactories.add(new VariableScopeResolverFactory());
resolverFactories.add(new BeansResolverFactory());
}
if (scriptingEngines == null) {
scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));
scriptingEngines.setEnableScriptEngineCaching(enableScriptEngineCaching);
}
if (scriptFactory == null) {
scriptFactory = new ScriptFactory();
}
if (scriptEnvResolvers == null) {
scriptEnvResolvers = new ArrayList<ScriptEnvResolver>();
}
if (scriptingEnvironment == null) {
scriptingEnvironment = new ScriptingEnvironment(scriptFactory, scriptEnvResolvers, scriptingEngines);
}
}
use of org.camunda.bpm.engine.impl.scripting.ScriptFactory in project camunda-bpm-platform by camunda.
the class JuelFormEngine method executeScript.
protected Object executeScript(String scriptSrc, VariableScope scope) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
ScriptFactory scriptFactory = processEngineConfiguration.getScriptFactory();
ExecutableScript script = scriptFactory.createScriptFromSource(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, scriptSrc);
ScriptInvocation invocation = new ScriptInvocation(script, scope);
try {
processEngineConfiguration.getDelegateInterceptor().handleInvocation(invocation);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new ProcessEngineException(e);
}
return invocation.getInvocationResult();
}
Aggregations