public class DefFunctions extends Object implements Function
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FUNCTION
The DEFAULT_FUNCTION.
|
static String |
SCENARIO_VARIABLE_ATTR
The GLOBAL VARIABLE ATTRIBUTE.
|
static String |
SCRIPT_FUNCTION
The SCRIPT_FUNCTION.
|
static String |
START_ATTR
The START ATTRIBUTE.
|
Constructor and Description |
---|
DefFunctions() |
Modifier and Type | Method and Description |
---|---|
String |
assignVar(LoadFunctionContext context)
Assigns value to variable.
|
String |
assignVar(LoadFunctionContext context,
String value)
Assigns value to variable.
|
String[] |
getAfterFunctions()
Gets the array of functions which will be executed after main etl action (insert, update, delete, merge, etc).
|
String[] |
getBeforeFunctions()
Gets the array of functions which will be executed before main etl action (insert, update, delete, merge, etc).
|
String[] |
getExcludeFunctions()
Gets the array of functions which will be executed to calculate visibility of the field.
|
String |
getFk(LoadFunctionContext context)
Gets the new value for the field from the corresponding "primary key"
field.
|
String |
getGlobalVarValue(LoadFunctionContext context)
Gets the global variable value.
|
String |
getPk(LoadFunctionContext context)
Gets the new value for the field using in-memory map or other mechanism,
for example db sequence.
|
String[] |
getRuntimeFunctions()
Gets the array of functions which will be executed at run time.
|
String |
getSeq(LoadFunctionContext context)
Gets the new value for the field using sequence.
|
protected String |
getSql(String sql)
Gets the sql.
|
int |
getSqlType(Variable var,
FieldDef fieldDef)
Gets the sql type.
|
Object |
getValue(LoadFunctionContext context)
Gets the current field value.
|
Object |
getValueFromRecordOrVar(LoadFunctionContext context)
Gets the value from the record or variable.
|
String |
getVariableValue(LoadFunctionContext context)
Gets the variable value from the current field value.
|
protected String |
getVarSql(ListHashMap<String,Variable> variables,
Variable var,
Driver driver,
Map<String,Variable> candidates)
Gets the sql associated with the variable.
|
protected String |
getVarSql(String set,
String varName,
String sql,
String pattern)
Gets the sql associated with the variable.
|
Object |
script(LoadFunctionContext context)
Executes script (typically JavaScript).
|
public static final String DEFAULT_FUNCTION
public static final String SCRIPT_FUNCTION
public static final String START_ATTR
public static final String SCENARIO_VARIABLE_ATTR
public String assignVar(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorpublic String assignVar(LoadFunctionContext context, String value) throws Exception
context
- the contextvalue
- the valueException
- the exceptionpublic String[] getAfterFunctions()
Function
getAfterFunctions
in interface Function
public String[] getBeforeFunctions()
Function
getBeforeFunctions
in interface Function
public String[] getExcludeFunctions()
Function
getExcludeFunctions
in interface Function
public String getFk(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorpublic String getGlobalVarValue(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorpublic String getPk(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorpublic String[] getRuntimeFunctions()
Function
getRuntimeFunctions
in interface Function
public String getSeq(LoadFunctionContext context) throws Exception
context
- the contextException
- the exception in case of any errorprotected String getSql(String sql)
sql
- the sqlpublic int getSqlType(Variable var, FieldDef fieldDef)
var
- the varfieldDef
- the field defpublic Object getValue(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorpublic Object getValueFromRecordOrVar(LoadFunctionContext context) throws Exception
context
- the contextException
- the exceptionpublic String getVariableValue(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorprotected String getVarSql(ListHashMap<String,Variable> variables, Variable var, Driver driver, Map<String,Variable> candidates)
variables
- the variablesvar
- the variabledriver
- the drivercandidates
- the candidatesprotected String getVarSql(String set, String varName, String sql, String pattern)
set
- the "set" tokenvarName
- the variable namesql
- the sqlpattern
- the patternpublic Object script(LoadFunctionContext context) throws Exception
context
- the contextException
- in case of any errorCopyright © 2010-2020 Toolsverse. All Rights Reserved.