public class AutomationScriptingServiceImpl extends Object implements AutomationScriptingService
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<ScriptEngine> |
engines |
protected String |
jsWrapper |
protected ScriptOperationContext |
operationContext |
protected ThreadLocal<ScriptOperationContext> |
operationContexts |
Constructor and Description |
---|
AutomationScriptingServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
generateFlatFunction(StringBuffer sb,
String opId) |
protected void |
generateFunction(StringBuffer sb,
String opId) |
<T> T |
getInterface(Class<T> scriptingOperationInterface,
String script,
CoreSession session) |
String |
getJSWrapper() |
protected String |
getJSWrapper(boolean refresh) |
protected void |
parseAutomationIDSForScripting(Map<String,List<String>> opMap,
List<String> flatOps,
String id) |
static String |
replaceDashByUnderscore(String id)
Prevents dashes in operation/chain ids.
|
void |
run(InputStream in,
CoreSession session)
Run Automation Scripting with given 'JavaScript' InputStream and CoreSession.
|
void |
run(String script,
CoreSession session)
Run Automation Scripting for a given 'JavaScript' script and CoreSession.
|
void |
setOperationContext(ScriptOperationContext ctx) |
protected ScriptOperationContext |
wrapContext(ScriptOperationContext ctx) |
protected ScriptOperationContext operationContext
protected final ThreadLocal<ScriptEngine> engines
protected final ThreadLocal<ScriptOperationContext> operationContexts
public AutomationScriptingServiceImpl()
protected String getJSWrapper(boolean refresh) throws OperationException
OperationException
public void setOperationContext(ScriptOperationContext ctx)
setOperationContext
in interface AutomationScriptingService
protected ScriptOperationContext wrapContext(ScriptOperationContext ctx)
public String getJSWrapper() throws OperationException
getJSWrapper
in interface AutomationScriptingService
OperationException
public void run(InputStream in, CoreSession session) throws ScriptException, OperationException
AutomationScriptingService
run
in interface AutomationScriptingService
ScriptException
OperationException
public void run(String script, CoreSession session) throws ScriptException, OperationException
AutomationScriptingService
run
in interface AutomationScriptingService
ScriptException
OperationException
public <T> T getInterface(Class<T> scriptingOperationInterface, String script, CoreSession session) throws ScriptException, OperationException
getInterface
in interface AutomationScriptingService
ScriptException
OperationException
protected void parseAutomationIDSForScripting(Map<String,List<String>> opMap, List<String> flatOps, String id)
protected void generateFunction(StringBuffer sb, String opId)
protected void generateFlatFunction(StringBuffer sb, String opId)
public static String replaceDashByUnderscore(String id)
Copyright © 2016 Nuxeo SA. All rights reserved.