diff --git a/custom-scripted-connector-bundler/pom.xml b/custom-scripted-connector-bundler/pom.xml index fed400d01a..a980d7d344 100644 --- a/custom-scripted-connector-bundler/pom.xml +++ b/custom-scripted-connector-bundler/pom.xml @@ -148,7 +148,7 @@ org.codehaus.groovy groovy-all - 2.2.2 + ${groovy.version} diff --git a/openidm-workflow-activiti/src/main/java/org/forgerock/openidm/workflow/activiti/impl/ActivitiServiceImpl.java b/openidm-workflow-activiti/src/main/java/org/forgerock/openidm/workflow/activiti/impl/ActivitiServiceImpl.java index 29d20b6bfe..ba2ccf7172 100644 --- a/openidm-workflow-activiti/src/main/java/org/forgerock/openidm/workflow/activiti/impl/ActivitiServiceImpl.java +++ b/openidm-workflow-activiti/src/main/java/org/forgerock/openidm/workflow/activiti/impl/ActivitiServiceImpl.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; +import javax.script.ScriptEngine; import javax.sql.DataSource; import javax.transaction.TransactionManager; import org.activiti.engine.ProcessEngine; @@ -44,6 +45,8 @@ import org.activiti.engine.impl.interceptor.SessionFactory; import org.activiti.engine.impl.scripting.ResolverFactory; import org.activiti.engine.impl.scripting.ScriptBindingsFactory; +import org.activiti.engine.impl.scripting.ScriptingEngines; +import org.activiti.osgi.Extender; import org.activiti.osgi.OsgiScriptingEngines; import org.activiti.osgi.blueprint.ProcessEngineFactory; import org.forgerock.openidm.datasource.DataSourceService; @@ -74,7 +77,10 @@ import org.forgerock.openidm.workflow.activiti.impl.session.OpenIDMSessionFactory; import org.forgerock.util.promise.Promise; import org.h2.jdbcx.JdbcDataSource; +import org.osgi.framework.Bundle; import org.osgi.framework.Constants; +import org.osgi.framework.ServiceFactory; +import org.osgi.framework.ServiceRegistration; import org.osgi.service.cm.Configuration; import org.osgi.service.cm.ConfigurationAdmin; import org.osgi.service.component.ComponentContext; @@ -471,12 +477,37 @@ protected void unbindProcessEngine(ProcessEngine processEngine) { target = "(service.pid=org.forgerock.openidm.script)") protected void bindScriptRegistry(ScriptRegistry scriptRegistry) { this.idmSessionFactory.setScriptRegistry(scriptRegistry); + Extender.getBundleContext().registerService(Extender.ScriptEngineResolver.class, new ServiceFactory() { + @Override + public Extender.ScriptEngineResolver getService(Bundle bundle, ServiceRegistration serviceRegistration) { + return new Extender.ScriptEngineResolver() { + @Override + public ScriptEngine resolveScriptEngine(String s) { + if (!"groovy".equalsIgnoreCase(s)) { + throw new RuntimeException("unknown resolveScriptEngine "+s); + } + return new org.codehaus.groovy.jsr223.GroovyScriptEngineImpl(); + } + }; + }; + + @Override + public void ungetService(Bundle bundle, ServiceRegistration serviceRegistration, Extender.ScriptEngineResolver scriptEngineResolver) { + + } + },null); } protected void unbindScriptRegistry(ScriptRegistry scriptRegistry) { this.idmSessionFactory.setScriptRegistry(null); } + @Reference( + name = "JavaDelegateServiceReference", + service = JavaDelegate.class, + unbind = "unbindService", + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC) public void bindService(JavaDelegate delegate, Map props) { expressionManager.bindService(delegate, props); } diff --git a/openidm-zip/src/main/assembly/zip.xml b/openidm-zip/src/main/assembly/zip.xml index 8ec2d10d48..f2ba2e7749 100644 --- a/openidm-zip/src/main/assembly/zip.xml +++ b/openidm-zip/src/main/assembly/zip.xml @@ -1207,6 +1207,7 @@ org.apache.httpcomponents:httpcore jakarta* org.bouncycastle:bc*-fips + org.openjdk.nashorn:*