Search in sources :

Example 1 with VariableScopeResolverFactory

use of org.activiti.engine.impl.scripting.VariableScopeResolverFactory in project herd by FINRAOS.

the class ServiceSpringModuleConfig method initScriptingEngines.

/**
 * Initializes the {@link ScriptingEngines} and optionally the {@link ResolverFactory} of the given {@link ProcessEngineConfigurationImpl}. The
 * initialization logic has been copied from the protected initScriptingEngines() method in {@link ProcessEngineConfigurationImpl}. This initialization will
 * use the {@link SecuredScriptingEngines} implementation of {@link ScriptingEngines}.
 *
 * @param configuration the {@link ProcessEngineConfigurationImpl} whom {@link ScriptingEngines} will be initialized.
 */
private void initScriptingEngines(ProcessEngineConfigurationImpl configuration) {
    List<ResolverFactory> resolverFactories = configuration.getResolverFactories();
    if (resolverFactories == null) {
        resolverFactories = new ArrayList<>();
        resolverFactories.add(new VariableScopeResolverFactory());
        resolverFactories.add(new BeansResolverFactory());
        configuration.setResolverFactories(resolverFactories);
    }
    configuration.setScriptingEngines(new SecuredScriptingEngines(new ScriptBindingsFactory(resolverFactories)));
}
Also used : BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ScriptBindingsFactory(org.activiti.engine.impl.scripting.ScriptBindingsFactory) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory) ResolverFactory(org.activiti.engine.impl.scripting.ResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory)

Example 2 with VariableScopeResolverFactory

use of org.activiti.engine.impl.scripting.VariableScopeResolverFactory in project carbon-business-process by wso2.

the class ActivitiEngineBuilder method setResolverFactories.

/**
 * Function to register resolver factories that used by script engines and JUEL
 * @param processEngineConfiguration
 */
private void setResolverFactories(ProcessEngineConfigurationImpl processEngineConfiguration) {
    List<ResolverFactory> resolverFactories = new ArrayList<>();
    // Resolvers from Activiti
    resolverFactories.add(new VariableScopeResolverFactory());
    resolverFactories.add(new BeansResolverFactory());
    // Resolvers added for WSO2 BPS
    resolverFactories.add(new XmlAPIResolverFactory());
    resolverFactories.add(new JsonAPIResolverFactory());
    processEngineConfiguration.setResolverFactories(resolverFactories);
}
Also used : JsonAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory) XmlAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ArrayList(java.util.ArrayList) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory) JsonAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory) XmlAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory) ResolverFactory(org.activiti.engine.impl.scripting.ResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory)

Example 3 with VariableScopeResolverFactory

use of org.activiti.engine.impl.scripting.VariableScopeResolverFactory in project Activiti by Activiti.

the class ProcessEngineFactoryWithELResolver method init.

@Override
public void init() throws Exception {
    ProcessEngineConfigurationImpl configImpl = (ProcessEngineConfigurationImpl) getProcessEngineConfiguration();
    configImpl.setExpressionManager(new BlueprintExpressionManager());
    List<ResolverFactory> resolverFactories = configImpl.getResolverFactories();
    if (resolverFactories == null) {
        resolverFactories = new ArrayList<ResolverFactory>();
        resolverFactories.add(new VariableScopeResolverFactory());
        resolverFactories.add(new BeansResolverFactory());
    }
    configImpl.setScriptingEngines(new OsgiScriptingEngines(new ScriptBindingsFactory(resolverFactories)));
    super.init();
}
Also used : BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ScriptBindingsFactory(org.activiti.engine.impl.scripting.ScriptBindingsFactory) OsgiScriptingEngines(org.activiti.osgi.OsgiScriptingEngines) ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ResolverFactory(org.activiti.engine.impl.scripting.ResolverFactory) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory)

Example 4 with VariableScopeResolverFactory

use of org.activiti.engine.impl.scripting.VariableScopeResolverFactory in project Activiti by Activiti.

the class ProcessEngineConfigurationImpl method initScriptingEngines.

public void initScriptingEngines() {
    if (resolverFactories == null) {
        resolverFactories = new ArrayList<ResolverFactory>();
        resolverFactories.add(new VariableScopeResolverFactory());
        resolverFactories.add(new BeansResolverFactory());
    }
    if (scriptingEngines == null) {
        scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(this, resolverFactories));
    }
}
Also used : ScriptingEngines(org.activiti.engine.impl.scripting.ScriptingEngines) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ScriptBindingsFactory(org.activiti.engine.impl.scripting.ScriptBindingsFactory) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ResolverFactory(org.activiti.engine.impl.scripting.ResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory)

Aggregations

BeansResolverFactory (org.activiti.engine.impl.scripting.BeansResolverFactory)4 ResolverFactory (org.activiti.engine.impl.scripting.ResolverFactory)4 VariableScopeResolverFactory (org.activiti.engine.impl.scripting.VariableScopeResolverFactory)4 ScriptBindingsFactory (org.activiti.engine.impl.scripting.ScriptBindingsFactory)3 ArrayList (java.util.ArrayList)1 ProcessEngineConfigurationImpl (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)1 ScriptingEngines (org.activiti.engine.impl.scripting.ScriptingEngines)1 OsgiScriptingEngines (org.activiti.osgi.OsgiScriptingEngines)1 JsonAPIResolverFactory (org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory)1 XmlAPIResolverFactory (org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory)1