Search in sources :

Example 1 with SecureJavascriptConfigurator

use of org.activiti.scripting.secure.SecureJavascriptConfigurator in project Activiti by Activiti.

the class SecureScriptingBaseTest method initProcessEngine.

@Before
public void initProcessEngine() {
    SecureJavascriptConfigurator configurator = new SecureJavascriptConfigurator().setWhiteListedClasses(new HashSet<String>(Arrays.asList("java.util.ArrayList", "org.activiti.test.scripting.secure.MyBean"))).setMaxStackDepth(10).setMaxScriptExecutionTime(3000L).setMaxMemoryUsed(3145728L);
    Map<Object, Object> beans = new HashMap<Object, Object>();
    beans.put("myBean", new MyBean());
    this.processEngine = new StandaloneInMemProcessEngineConfiguration().addConfigurator(configurator).setBeans(beans).setDatabaseSchemaUpdate("create-drop").setEnableProcessDefinitionInfoCache(true).buildProcessEngine();
    this.runtimeService = processEngine.getRuntimeService();
    this.repositoryService = processEngine.getRepositoryService();
    this.taskService = processEngine.getTaskService();
    this.historyService = processEngine.getHistoryService();
    this.dynamicBpmnService = processEngine.getDynamicBpmnService();
}
Also used : HashMap(java.util.HashMap) SecureJavascriptConfigurator(org.activiti.scripting.secure.SecureJavascriptConfigurator) StandaloneInMemProcessEngineConfiguration(org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 StandaloneInMemProcessEngineConfiguration (org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)1 SecureJavascriptConfigurator (org.activiti.scripting.secure.SecureJavascriptConfigurator)1 Before (org.junit.Before)1