package org.springblade.flow.engine.custom.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

/**
 * @author LoveMyOrange
 * @create 2022-01-31 15:44
 * @desc 条件解析引擎
 */
@Configuration
public class ScriptEngineConfig {
    /**
     * 脚本引擎 JDK内置 但已经在JDK15之后弃用
     * @return
     */
    @Bean
    public ScriptEngine nashornEngine(){
        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("nashorn");
        return scriptEngine;
    }
}
