public class AutomationScriptingServiceImpl extends Object implements AutomationScriptingService
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<ScriptEngine> |
engines |
protected String |
jsWrapper |
protected OperationContext |
operationContext |
protected ThreadLocal<OperationContext> |
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(OperationContext ctx) |
protected OperationContext |
wrapContext(OperationContext ctx) |
protected OperationContext operationContext
protected final ThreadLocal<ScriptEngine> engines
protected final ThreadLocal<OperationContext> operationContexts
public AutomationScriptingServiceImpl()
protected String getJSWrapper(boolean refresh) throws OperationException
OperationException
public void setOperationContext(OperationContext ctx)
setOperationContext
in interface AutomationScriptingService
protected OperationContext wrapContext(OperationContext 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 © 2015 Nuxeo SA. All rights reserved.