|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.webmbt.plugin.MbtScriptExecutor
public class MbtScriptExecutor
Executes the mScript.
| Nested Class Summary | |
|---|---|
static interface |
MbtScriptExecutor.MSCRIPT_METHOD
Indicates that the annotated method is a test method. |
| Field Summary | |
|---|---|
java.lang.String |
seqOutPrefix
to be added to the beginning of every seqout message call. |
| Constructor Summary | |
|---|---|
MbtScriptExecutor(com.webmbt.ExecutionDirector execDirector_p,
com.webmbt.FSM.MbtExecWorker execWorker_p)
INTERNAL USE ONLY. |
|
| Method Summary | |
|---|---|
void |
abort(java.lang.String msg_p)
raises Exception to cause the MBT execution to abort. |
void |
actionDelay(com.webmbt.scxml.TransitionNode transNode_p)
INTERNAL USE ONLY. |
java.lang.String |
add(java.lang.String expr1,
java.lang.String expr2)
add two exprs. |
void |
addTagCheck(java.lang.String tag_p,
java.lang.String passed_p,
java.lang.String msg_p)
adds a tag check/validation message to the tag stat. |
boolean |
and(java.lang.String expr1_p,
java.lang.String expr2_p)
performs AND operation on the two mScript expressions passed in and returns a true if both expressions evaluate to true, else return false. |
boolean |
and(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
performs AND operation on the three mScript expressions passed in and returns a true if all expressions evaluate to true, else return false. |
java.lang.String |
callFunc(java.lang.String funcName_p)
calls a user function without parameters. |
java.lang.String |
callFunc(java.lang.String funcName_p,
java.lang.String params_p)
calls a user function with parameters. |
java.lang.String |
callURL(java.lang.String urlString_p)
calls the url passed in and returns the content returned from the url. |
java.lang.String |
checkSeqNum()
returns the current seqNum without incrementing it. |
java.lang.String |
chooseMsg(java.lang.String expr_p,
java.lang.String trueMsg_p,
java.lang.String falseMsg_p)
evaluates the expression passed in, if the expression evaluates to true, it returns the value from the trueMsg_p expression (may contain other mScript function calls). |
void |
clearAllPathVars()
clears all variables on the current traversal path. |
void |
close()
perform the cleanup including causing all plugins to be closed/destroyed. |
boolean |
compare(java.lang.String expr1_p,
java.lang.String op_p,
java.lang.String expr2_p)
performs comparison between two expressions passed in using the operator specified. |
java.lang.String |
dataSetInfo(java.lang.String dataSetID_p)
returns the data set info in a string. |
java.lang.String |
date()
returns todays date string in standard format: MM/dd/yyyy. |
java.lang.String |
date(java.lang.String dateExpr_p)
returns a date string in standard format MM/dd/yyyy. |
java.lang.String |
date(java.lang.String dateExpr_p,
java.lang.String dateFmr_p)
returns a date string in java date format specified. |
void |
debug(java.lang.String msg_p)
INTERNAL USE ONLY. |
java.lang.String |
decrement(java.lang.String varName_p)
decrement the variable by 1. |
void |
entryDelay(com.webmbt.scxml.StateNode state_p)
INTERNAL USE ONLY. |
void |
error(java.lang.Exception e)
INTERNAL USE ONLY. |
void |
error(java.lang.String msg_p)
INTERNAL USE ONLY. |
void |
error(java.lang.String msg_p,
java.lang.Throwable e_p)
INTERNAL USE ONLY. |
java.lang.String |
evalExpr(java.lang.String expr_p)
performs mScript expression evaluation. |
int |
evalExprToInt(java.lang.String expr_p)
performs mScript expression evaluation to an integer. |
boolean |
evalGuard(com.webmbt.scxml.TransitionNode transObj_p)
INTERNAL USE ONLY evaluates the guard condition of the transition passed in. |
java.lang.String |
execMScriptMethod(java.lang.String methodScript_p)
INTERNAL USE ONLY. |
java.lang.String |
execSQL(java.lang.String dbID_p,
java.lang.String sqlStmt_p,
java.lang.String colName_p,
java.lang.String delimeter_p)
executes an SQL statement and return the result from the specified column name with rows separated by the delimited specified |
com.webmbt.mscript.UserFuncScriptCall |
executeFunc(java.lang.String funcName_p,
java.util.HashMap<java.lang.String,java.lang.String> params_p)
calls a user function. |
boolean |
executeScript(com.webmbt.ScriptDesc script_p)
INTERNAL USE ONLY. |
java.lang.Integer |
findData(java.lang.String dataSetID_p,
java.lang.String fieldNames_p,
java.lang.String compValues_p)
Returns the number of data rows found to match the compValues_p. |
java.lang.Integer |
findDataRowIndex(java.lang.String dataSetID_p,
java.lang.String fieldNames_p,
java.lang.String compValues_p)
Returns the row index of the first data row found that matches the compValues_p. |
java.lang.String |
getBrowser()
returns browser set for the model. |
java.lang.String |
getBrowserVersion()
returns version number of the brower set for the model, for example IE 7 it will return "7". |
java.lang.String |
getData(java.lang.String dataSetIDFieldName_p)
returns the field in the data set at the current row. |
java.lang.String |
getData(java.lang.String dataSetID_p,
java.lang.String fieldName_p)
return the field in the data set at the current row. |
java.lang.String |
getData(java.lang.String dataSetID_p,
java.lang.String rowIdx_p,
java.lang.String fieldName_p)
return the field in the data set at the row specified in the rowIdx_p. |
java.lang.String[] |
getDataAllRows(java.lang.String dataSetID_p,
java.lang.String fieldName_p)
returns column fieldName_p for all rows in the data set in a string separated by semi-colon ";". |
com.webmbt.mscript.DataManager |
getDataMgr()
INTERNAL USE ONLY |
java.lang.String |
getDataSetRow(java.lang.String dataSetID_p)
returns the current row in a string with key=value,key=value |
int |
getDataSetRowNum(java.lang.String dataSetID_p)
returns the current row index |
static java.lang.String |
getDefaultMbtScriptName(com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
INTERNAL USE ONLY. |
static java.lang.String |
getDefaultScriptName(com.webmbt.scxml.StateNode stateNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
INTERNAL USE ONLY. |
static java.lang.String |
getDefaultScriptName(com.webmbt.scxml.TransitionNode transNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
INTERNAL USE ONLY. |
static java.lang.String |
getDefaultScriptName(com.webmbt.scxml.UseCaseNode useCaseNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
INTERNAL USE ONLY. |
static java.lang.String |
getDefaultScriptName(com.webmbt.scxml.UseCaseStepNode stepNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
INTERNAL USE ONLY. |
static java.util.ArrayList<com.webmbt.MBTException> |
getExceptionList()
INTERNAL USE ONLY. |
com.webmbt.ExecutionDirector |
getExecDirector()
INTERNAL USE ONLY. |
com.webmbt.FSM.MbtExecWorker |
getExecWorker()
INTERNAL USE ONLY. |
java.lang.String |
getFuncParam(java.lang.String paramName_p)
returns the param value for the user function in current scope. |
org.apache.log4j.Logger |
getLogObj()
INTERNAL USE ONLY. |
com.webmbt.scxml.MbtNode |
getMbtNode()
INTERNAL USE ONLY. |
static java.lang.String[] |
getMbtScriptMethodList()
INTERNAL USE ONLY. |
com.webmbt.ModelMgr |
getModelMgr()
|
static java.util.List<java.lang.reflect.Method> |
getMScriptMethodDeclareList(java.lang.Class class_p,
java.lang.Class filterClass_p)
|
java.lang.Object |
getPathVar(java.lang.String varName_p)
retrieve a variable from the current traversal path. |
java.lang.String |
getPluginID()
returns ID of the plugin currently selected for the model. |
java.util.List<PluginAncestor> |
getPluginList()
INTERNAL USE ONLY. |
PluginMgr |
getPluginMgr()
|
com.webmbt.scxml.ScxmlNode |
getScxmlNode()
INTERNAL USE ONLY. |
SeqOutPlugin |
getSeqOutPlugin()
INTERNAL USE ONLY |
java.lang.String |
getSysConfig(java.lang.String propertyName_p)
returns the property value from the system config. |
java.lang.String |
getSysConfig(java.lang.String propertyName_p,
java.lang.String defaultValue_p)
returns the property value from the system config. |
java.lang.String |
getSysVar(java.lang.String varName_p)
Returns value for the system variable. |
java.lang.String |
getSysVar(java.lang.String varName_p,
java.lang.String param_p)
returns system variable that requires a parameter. |
java.lang.String |
getTransData(java.lang.String fieldName_p)
retrieves the DDT field value defined for the current transition. |
java.lang.Object |
getVar(java.lang.String varName_p)
Returns the value for the varName_p passed in. |
java.lang.String |
getVar(java.lang.String varName_p,
java.lang.String index_p)
Returns the value for the variable at the index passed in. |
java.lang.String[] |
getVarAllRows(java.lang.String varName_p)
returns a field on all rows in the data set, that is, returns a column in the data set. |
java.util.HashMap<java.lang.String,java.lang.Object> |
getVarList()
|
int |
getVarRowNum(java.lang.String varName_p)
Returns the current row number (subscript) of the variable name passed in. |
void |
gotoState(java.lang.String gotoStateID_p)
requests next state be set to the state id specified. |
void |
gotoTrans(java.lang.String gotoTransStateID_p,
java.lang.String gotoTransID_p)
requests the transition passed in be performed next. |
void |
gotoURL(java.lang.String url_p)
Set current web page to the url passed in. |
java.lang.String |
ifFalseMsg(java.lang.String expr_p,
java.lang.String msg_p)
evaluates the expression passed in, if the expression evaluates to false, it returns the message expression (may contain other mScript function calls). |
java.lang.String |
ifTrueMsg(java.lang.String expr_p,
java.lang.String msg_p)
evaluates the expression passed in, if the expression evaluates to true, it returns the message expression (may contain other mScript function calls). |
java.lang.String |
increment(java.lang.String varName_p)
increments the variable by 1. |
java.lang.String |
increment(java.lang.String varName_p,
java.lang.String delta_p)
increment the variable by the delta passed in. |
void |
info(java.lang.String msg_p)
INTERNAL USE ONLY. |
void |
init()
INTERNAL USE ONLY. |
void |
internalLoadDataSet(java.lang.String dataSetID_p,
java.lang.String... paramList_p)
INTERNAL USE ONLY. |
boolean |
isFalse(java.lang.String expr_p)
evaluates the mScript expression and return the negation of the boolean result from the expression. |
boolean |
isModelRunning(java.lang.String modelName_p)
returns true if the model specified is also running in the same TestOptimal server. |
boolean |
isTrue(java.lang.String expr_p)
evaluates the mScript expression and return true if the result is one of the representation of Boolean true: true, T, 1, yes, Y, etc. |
java.lang.String |
listFuncParams()
returns a string that represent parameters. |
void |
loadFromDataSource(java.lang.String dataSetID_p)
loads the data set from the data source defined without parameters. |
void |
loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p)
loads the data set from the data source defined with one parameter. |
void |
loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p)
loads the data set from the data source defined with two parameters. |
void |
loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p)
loads the data set from the data source defined with three parameters. |
void |
loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p,
java.lang.String param4_p)
loads the data set from the data source defined with four parameters. |
void |
loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p,
java.lang.String param4_p,
java.lang.String param5_p)
loads the data set from the data source defined with five parameters. |
void |
mscriptDelay()
INTERNAL USE ONLY. |
java.lang.String |
multiply(java.lang.String expr1,
java.lang.String expr2)
multiply two exprs. |
boolean |
nand(java.lang.String expr1_p,
java.lang.String expr2_p)
|
boolean |
nand(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
performs NAND on the expression list passed. |
int |
nextDataSetRow(java.lang.String dataSetID_p)
moves data set to next row. |
int |
nextDataSetRow(java.lang.String dataSetID_p,
java.lang.String floatIdx_p)
moves the data set to a row randomly selected. |
int |
nextVarRow(java.lang.String varName_p)
Advances the variable current row number by 1. |
boolean |
nor(java.lang.String expr1_p,
java.lang.String expr2_p)
|
boolean |
nor(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
performs NOR on the expression list passed. |
boolean |
not(java.lang.String expr_p)
evaluates the mScript expression and return the negation of the boolean result from the expression. |
boolean |
or(java.lang.String expr1_p,
java.lang.String expr2_p)
performs OR operation on the two mScript expressions passed in and returns a true if any of the expressions evaluates to true, else return false. |
boolean |
or(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
performs OR operation on the three mScript expressions passed in and returns a true if any of the expressions evaluates to true, else return false. |
void |
osCmd(java.lang.String cmd_p)
osCmd: runs an os command. |
void |
osCmd(java.lang.String cmd_p,
java.lang.String killAfterMillis_p)
osCmd: runs an os command, waits for the specified milliseconds and stops the application. |
void |
osCmdAsynch(java.lang.String cmd_p)
osCmd: runs an os command asynchronously. |
java.lang.String |
peek(java.lang.String varName_p)
peeks the last value in stack without pop it. |
java.lang.String |
pop(java.lang.String varName_p)
pops the last value from stack. |
void |
popAll(java.lang.String varName_p)
clears the stack. |
void |
push(java.lang.String varName_p,
java.lang.String value_p)
push a value into a stack variable. |
float |
rand()
returns a random number in float between 0 (inclusive) and 1 (exclusive). |
int |
rand(java.lang.String limit_p)
returns a random integer number between 0 (inclusive) and limit_p (exclusive). |
int |
rand(java.lang.String startInt_p,
java.lang.String endInt_p)
returns a random integer number between startInt_p (inclusive) and endInt_p (exclusive). |
java.lang.String |
rand(java.lang.String startNum_p,
java.lang.String endNum_p,
java.lang.String precisionDigit_p)
returns a random integer number between startInt_p (inclusive) and endInt_p (exclusive). |
boolean |
randBool()
returns a randomly chosen true or false. |
void |
registerVarChangeListener(com.webmbt.mscript.VarChangeListener listener_p)
INTERNAL USE ONLY |
void |
removeVarChangeListener(com.webmbt.mscript.VarChangeListener listener_p)
INTERNAL USE ONLY |
void |
resetSeqNum()
resets the seqNum sys var to 0. |
void |
rewindDataSet(java.lang.String dataSetID_p)
reset the data set to start at the first row. |
int |
rewindVar(java.lang.String varName_p)
sets the current row number for the variable to 0. |
void |
sendMail(java.lang.String fromAddress,
java.lang.String toAddress,
java.lang.String subject,
java.lang.String messageText)
send mail. |
void |
seqout(java.lang.String seqText_p)
writes a message to seq.out (SeqOut) file in the model folder. |
boolean |
setData(java.lang.String dataSetID_p,
java.lang.String fieldName_p,
java.lang.String value_p)
changes a field in the data set. |
void |
setDataSetRow(java.lang.String dataSetID_p,
java.lang.String rowIdx_p)
moves the data set to a row specified. |
void |
setFuncReturn(java.lang.String retVal_p)
sets the return value for the current user function. |
void |
setPathVar(java.lang.String varName_p,
java.lang.String varVal_p)
sets a specific traversal path variable to the value passed in. |
void |
setPathVarObj(java.lang.String varName_p,
java.lang.Object varVal_p)
|
void |
setSeqNum(java.lang.String seqNum_p)
sets sys var seqNum to the value specified. |
boolean |
setVar(java.lang.String varName_p,
java.lang.String toValue_p)
returns true if value has changed. |
boolean |
setVar(java.lang.String varName_p,
java.lang.String toValue_p,
java.lang.String modelName_p)
Sets a variable on a different model execution. |
void |
setVarRowNum(java.lang.String varName_p,
java.lang.String rowNum_p)
Sets the current row number (subscript) for mbt variable passed in. |
static void |
shutdown()
INTERNAL USE ONLY. |
void |
sleep(java.lang.String millis_p)
sleeps for number of milliseconds. |
java.lang.String |
snapScreen()
To cause a snapshot of current screen of AUT. |
java.lang.String |
snapScreen(java.lang.String fileName_p)
To cause a snapshot of current screen of AUT. |
java.lang.String |
time()
returns current time in string in standard time format MM/dd/yyyy HH:mm. |
java.lang.String |
time(java.lang.String timeExpr_p)
returns time in a string in standard time format MM/dd/yyyy HH:mm. |
java.lang.String |
time(java.lang.String timeExpr_p,
java.lang.String timeFmt_p)
returns a time string in java date/time format specified. |
java.lang.String |
trace(java.lang.String maxLogCount_p)
returns the trace in a string of last maxLogCount_p traversals leading up to the current state/transition. |
boolean |
useSeqOutPlugin()
INTERNAL USE ONLY |
java.lang.String |
waitForVarChanged(java.lang.String varName_p)
waits until the variable specified has changed its value and return the new value. |
java.lang.String |
waitForVarChanged(java.lang.String varName_p,
java.lang.String timeoutMillis_p)
waits until the variable specified has changed its value and return the new value. |
java.lang.String |
waitForVarChanged(java.lang.String varName_p,
java.lang.String timeoutMillis_p,
java.lang.String newValue_p)
waits until the variable specified has changed its value. |
boolean |
xor(java.lang.String expr1_p,
java.lang.String expr2_p)
|
boolean |
xor(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
performs XOR on the expression list passed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String seqOutPrefix
| Constructor Detail |
|---|
public MbtScriptExecutor(com.webmbt.ExecutionDirector execDirector_p,
com.webmbt.FSM.MbtExecWorker execWorker_p)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public static java.util.ArrayList<com.webmbt.MBTException> getExceptionList()
public static java.lang.String[] getMbtScriptMethodList()
public void debug(java.lang.String msg_p)
msg_p - public void info(java.lang.String msg_p)
msg_p - public void error(java.lang.String msg_p)
msg_p - public org.apache.log4j.Logger getLogObj()
public void error(java.lang.String msg_p,
java.lang.Throwable e_p)
msg_p - e_p - public void error(java.lang.Exception e)
e - public static java.lang.String getDefaultMbtScriptName(com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
execType_p -
public static java.lang.String getDefaultScriptName(com.webmbt.scxml.StateNode stateNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
stateNode_p - execType_p -
public static java.lang.String getDefaultScriptName(com.webmbt.scxml.TransitionNode transNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
transNode_p - execType_p -
public static java.lang.String getDefaultScriptName(com.webmbt.scxml.UseCaseStepNode stepNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
stepNode_p - execType_p -
public static java.lang.String getDefaultScriptName(com.webmbt.scxml.UseCaseNode useCaseNode_p,
com.webmbt.mscript.tag.ScriptTag.ScriptType execType_p)
useCaseNode_p - execType_p -
public com.webmbt.scxml.MbtNode getMbtNode()
public com.webmbt.scxml.ScxmlNode getScxmlNode()
public com.webmbt.ModelMgr getModelMgr()
public com.webmbt.FSM.MbtExecWorker getExecWorker()
public com.webmbt.ExecutionDirector getExecDirector()
public boolean executeScript(com.webmbt.ScriptDesc script_p)
throws java.lang.Exception
scriptMethodName_p - method name
java.lang.Exception
public static java.util.List<java.lang.reflect.Method> getMScriptMethodDeclareList(java.lang.Class class_p,
java.lang.Class filterClass_p)
public static void shutdown()
public com.webmbt.mscript.UserFuncScriptCall executeFunc(java.lang.String funcName_p,
java.util.HashMap<java.lang.String,java.lang.String> params_p)
throws java.lang.Exception
funcName_p -
java.lang.Exceptionpublic void actionDelay(com.webmbt.scxml.TransitionNode transNode_p)
public void mscriptDelay()
public void entryDelay(com.webmbt.scxml.StateNode state_p)
public java.util.List<PluginAncestor> getPluginList()
public void init()
throws java.lang.Exception
java.lang.Exception
public void internalLoadDataSet(java.lang.String dataSetID_p,
java.lang.String... paramList_p)
throws java.lang.Exception
java.lang.Exceptionpublic com.webmbt.mscript.DataManager getDataMgr()
public void registerVarChangeListener(com.webmbt.mscript.VarChangeListener listener_p)
listener_p - public void removeVarChangeListener(com.webmbt.mscript.VarChangeListener listener_p)
listener_p -
public java.lang.String execMScriptMethod(java.lang.String methodScript_p)
throws java.lang.Exception
java.lang.Exception
public void loadFromDataSource(java.lang.String dataSetID_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS')"/>
dataSetID_p - data set id. data set id must be unique among all data sets.
java.lang.Exception - on any error
public void loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS', 'p1')"/>
dataSetID_p - data set id, data set id must be unique among all data sets.param1_p - parameter to be used to load the data from the data source
java.lang.Exception - on any error
public void loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS','p1','p2')"/>
dataSetID_p - data set id, data set id must be unique among all data sets.param1_p - value for the first parameter in the load queryparam2_p - value for the second parameter in the load query
java.lang.Exception - on any error
public void loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS','p1','p2','p3')"/>
dataSetID_p - data set id, data set id must be unique among all data sets.param1_p - value for the first parameter in the load queryparam2_p - value for the second parameter in the load queryparam3_p - value for the third parameter in the load query
java.lang.Exception
public void loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p,
java.lang.String param4_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS','p1','p2','p3','p4')"/>
dataSetID_p - data set id, data set id must be unique among all data sets.param1_p - value for the first parameter in the load queryparam2_p - value for the second parameter in the load queryparam3_p - value for the third parameter in the load queryparam4_p - value for the fourth parameter in the load query
java.lang.Exception
public void loadFromDataSource(java.lang.String dataSetID_p,
java.lang.String param1_p,
java.lang.String param2_p,
java.lang.String param3_p,
java.lang.String param4_p,
java.lang.String param5_p)
throws java.lang.Exception
Example: <action code="$loadFromDataSource('myDS','p1','p2','p3','p4','p5')"/>
dataSetID_p - data set id, data set id must be unique among all data sets.param1_p - value for the first parameter in the load queryparam2_p - value for the second parameter in the load queryparam3_p - value for the third parameter in the load queryparam4_p - value for the fourth parameter in the load queryparam5_p - value for the fifth parameter in the load query
java.lang.Exceptionpublic void close()
use this method to perform any cleanup you might want to do before the execution is completed. A typical use might be to write a record to database to indicate the execution completed and time of completion.
INTERNAL USE ONLY
public java.lang.String snapScreen()
throws java.lang.Exception
Typical use of this method is to call it in The screen shot will be marked with the first exception (if multiple exceptions) triggered by
current mScript and thus available from the exception popup.
Example: <action code="$snapScreen()"/>
java.lang.Exceptiontrace(java.lang.String)
public java.lang.String snapScreen(java.lang.String fileName_p)
throws java.lang.Exception
Typical use of this method is to call it in The screen shot will be marked with the first exception (if multiple exceptions) triggered by
current mScript and thus available from the exception popup.
Example: <action code="$snapScreen('myFileName')"/>
fileName_p - name of the file, final file name will suffixed with "_timestamp".
java.lang.Exceptiontrace(java.lang.String)
public void gotoURL(java.lang.String url_p)
throws java.lang.Exception
It may be used to force current page to be at the specified url on error or failure to reset the page to the correct page for the subsequent sequence to continue.
Example: <action code="$gotoURL('http://google.com')"/>
java.lang.Exception
public void osCmd(java.lang.String cmd_p)
throws java.lang.Exception
A typical use might be to call OS email utilty to send email or run a batch file or shell script to perform certain action. Note this method does not return a result.
Use this command to run an external application or scripts that will complete right away. If the application will stay up, use $osCmdAsynch() instead.
Example: <action code="$osCmd('dir c:/')"/>
java.lang.ExceptionosCmdAsynch()
public void osCmdAsynch(java.lang.String cmd_p)
throws java.lang.Exception
A typical use might be to call OS email utilty to send email or run a batch file or shell script to perform certain action. Note this method does not return a result.
Example: <action code="$osCmdAsynch('c:/myapp.exe')"/>
java.lang.ExceptionosCmdAsynch()
public void osCmd(java.lang.String cmd_p,
java.lang.String killAfterMillis_p)
throws java.lang.Exception
A typical use might be to call OS perform an operation using os command or custom application (exe).
Example: <action code="$osCmd('c:/myApp.exe','5000')"/>
java.lang.Exception
public void abort(java.lang.String msg_p)
throws java.lang.Exception
Can be used anywhere in mScript. It will trigger
Example:
<if val1="$containsText('FATAL ERROR XYZ')" op="eq" val2="true">
nbsp;<action code="$abort('Fatal error detected')"/>
</if>
java.lang.Exceptionpublic int nextDataSetRow(java.lang.String dataSetID_p)
Example: <action code="$nextDataSetRow('myDS')"/>
dataSetID_p - data set id
public int nextDataSetRow(java.lang.String dataSetID_p,
java.lang.String floatIdx_p)
Example, "$nextDataSetRow('ds1', '0.5')" will attempt to set to a row in the middle of the data set. On any error, it will set the data set to the next row.
floatIdx_p - a random float number between 0 and 1, use 0 for first row, 1.0 for last row, 0.5 for the middle row in the data set.dataSetID_p - data set iddataSetID_p - data set id
public void setDataSetRow(java.lang.String dataSetID_p,
java.lang.String rowIdx_p)
Example, "$setDataSetRow('ds1', '2')" will attempt to set to the 3rd row in the data set.
floatIdx_p - row number 0-based.dataSetID_p - data set idpublic void rewindDataSet(java.lang.String dataSetID_p)
Example: <action code="$rewindDataSet('myDS')"/>
dataSetID_p - data set idpublic java.lang.String dataSetInfo(java.lang.String dataSetID_p)
Use this method for debugging to examine the status of the data set.
Example: <log msg="$dataSetInfo('ds1')"/>.
dataSetID_p - data set id
public java.lang.String[] getDataAllRows(java.lang.String dataSetID_p,
java.lang.String fieldName_p)
Example: <log msg="DataSet myDS.F1: $getDataAllRows('myDS', 'F1')"/>
dataSetID_p - data set idfieldName_p - field name
public java.lang.String getDataSetRow(java.lang.String dataSetID_p)
Example: <log msg="current dataset row for myDS: $getDataSetRow('myDS')"/>
dataSetID_p - data set id
public int getDataSetRowNum(java.lang.String dataSetID_p)
Example: <log msg="current dataset row for myDS: $getDataSetRowNum('myDS')"/>
dataSetID_p - data set id
public java.lang.String getData(java.lang.String dataSetID_p,
java.lang.String rowIdx_p,
java.lang.String fieldName_p)
throws com.webmbt.MBTException
Example: <log msg="current row F1 on myDS: $getData('myDS','F1')"/>
dataSetID_p - data set idrowIdx_p - row indexfieldName_p - field name
com.webmbt.MBTException
public java.lang.String getData(java.lang.String dataSetID_p,
java.lang.String fieldName_p)
throws com.webmbt.MBTException
Example: <log msg="current row F1 on myDS: $getData('myDS','F1')"/>
dataSetID_p - data set idfieldName_p - field name
com.webmbt.MBTException
public java.lang.String getData(java.lang.String dataSetIDFieldName_p)
throws com.webmbt.MBTException
Example "$getData('ds1:f1')" to return the value of field "f1" in data set "ds1" at the current row.
dataSetIDFieldName_p - data set id and field name combined separated by colon ":".
com.webmbt.MBTException
public boolean setData(java.lang.String dataSetID_p,
java.lang.String fieldName_p,
java.lang.String value_p)
Example: "$setData('ds1', 'f1', 'newVal')".
dataSetID_p - data set idfieldName_p - field namevalue_p - new value for the field
public java.lang.Integer findData(java.lang.String dataSetID_p,
java.lang.String fieldNames_p,
java.lang.String compValues_p)
Example, "$findData('ds1', 'f1', 'val1')" will return number of rows from data set 'ds1' that has field 'f1' with value of 'val1'.
You may find by multiple columns, for example "$findData('ds1', 'f1;f2', 'val1;val2')" will return the count of rows that match fields f1 and f2 with values val1 and val2 respectively.
dataSetID_p - data set idfieldNames_p - names of the field that will form the string to match the compValues_p.compValues_p - string formed to match the return field values as specified in the fieldNames_p.
public java.lang.Integer findDataRowIndex(java.lang.String dataSetID_p,
java.lang.String fieldNames_p,
java.lang.String compValues_p)
Example, "$findDataRowIndex('ds1', 'f1', 'val1')" will return the row index of the first row found with field 'f1' with value of 'val1' in dataset 'ds1'.
You may find by multiple columns, for example "$findData('ds1', 'f1;f2', 'val1;val2')" will return the count of rows that match fields f1 and f2 with values val1 and val2 respectively.
dataSetID_p - data set idfieldNames_p - names of the field that will form the string to match the compValues_p.compValues_p - string formed to match the return field values as specified in the fieldNames_p.
public java.lang.Object getVar(java.lang.String varName_p)
throws com.webmbt.MBTException
Example, "$getVar('myVar1')". With release 3.0, you may use token syntax to access system var like "[myVar1]".
varName_p - name of the user variable.
com.webmbt.MBTExceptionpublic java.lang.String[] getVarAllRows(java.lang.String varName_p)
Example, "$getVarRows('var1')".
varName_p - name of the variable.
public java.lang.String getVar(java.lang.String varName_p,
java.lang.String index_p)
Example, "$getVar('var1', '2')" to get the 2nd value in the variable.
varName_p - name of the variable.index_p - 0-based index
public boolean setVar(java.lang.String varName_p,
java.lang.String toValue_p)
throws java.lang.Exception
Example: <action code="$setVar('myVar','123')"/>
varName_p - variable nametoValue_p - new value
if - the variable has a change listener defined and it errored in the listener.
java.lang.Exception
public boolean setVar(java.lang.String varName_p,
java.lang.String toValue_p,
java.lang.String modelName_p)
This function requires multiple user session license
Example: $setVar('var2','xyz','Model2')
varName_p - toValue_p - modelName_p -
public boolean isModelRunning(java.lang.String modelName_p)
Example: $isModelRunning('model2')
modelName_p - name of the model
public void setVarRowNum(java.lang.String varName_p,
java.lang.String rowNum_p)
varName_p - variable namerowNum_p - row number 0-based.public int getVarRowNum(java.lang.String varName_p)
varName_p -
public int nextVarRow(java.lang.String varName_p)
varName_p -
public int rewindVar(java.lang.String varName_p)
Example: "$rewindVar('var1')" to rewind the variable 'var1' if it has been set to contain array.
varName_p -
public java.lang.String getSysVar(java.lang.String varName_p)
throws java.lang.Exception
java.lang.Exception
public java.lang.String getSysVar(java.lang.String varName_p,
java.lang.String param_p)
throws java.lang.Exception
varName_p - name of the variableparam_p - parameter
java.lang.Exception
public java.lang.Object getPathVar(java.lang.String varName_p)
throws com.webmbt.MBTException
Example: $getPathVar('messageTriggered')
com.webmbt.MBTException
public void clearAllPathVars()
throws com.webmbt.MBTException
Example: $getPathVar('messageTriggered')
com.webmbt.MBTException
public void setPathVar(java.lang.String varName_p,
java.lang.String varVal_p)
throws com.webmbt.MBTException
Example: $setPathVar('msgTriggerred','packet1')
com.webmbt.MBTException
public void setPathVarObj(java.lang.String varName_p,
java.lang.Object varVal_p)
throws com.webmbt.MBTException
com.webmbt.MBTException
public java.lang.String date()
throws com.webmbt.MBTException
com.webmbt.MBTException
public java.lang.String date(java.lang.String dateExpr_p)
throws com.webmbt.MBTException
dateExpr_p - date expression as described above.
com.webmbt.MBTException
public java.lang.String time()
throws com.webmbt.MBTException
com.webmbt.MBTException
public java.lang.String time(java.lang.String timeExpr_p)
throws com.webmbt.MBTException
timeExpr_p - time expression as described above.
com.webmbt.MBTException
public java.lang.String date(java.lang.String dateExpr_p,
java.lang.String dateFmr_p)
throws com.webmbt.MBTException
dateExpr_p - date expression as described above.dateFmr_p - date format to be used to format the date into string. Accept java date simple date
format, for example "MM/dd/yyyy". You may also use "epoch" as the format string to retrieve date
in number of milliseconds since Jan. 1, 1970 (epoch time).
com.webmbt.MBTExceptionhttp://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
public java.lang.String time(java.lang.String timeExpr_p,
java.lang.String timeFmt_p)
throws com.webmbt.MBTException
timeExpr_p - time expression as described above.timeFmt_p - date/time format to be used to format the date/time into string. Accept java date simple date
format, for example "MM/dd/yyyy hh:mm:ss". You may also use "epoch" as the format string to retrieve date
in number of milliseconds since Jan. 1, 1970 (epoch time).
com.webmbt.MBTExceptionhttp://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
public float rand()
throws java.lang.Exception
java.lang.Exception
public int rand(java.lang.String limit_p)
throws java.lang.Exception
Example: $rand('10')
limit_p - upper limit (excluded)
java.lang.Exception
public int rand(java.lang.String startInt_p,
java.lang.String endInt_p)
throws java.lang.Exception
Example, "$rand('2', '5')" to return a random integer of 2, 3, or 4.
startInt_p - min value inclusiveendInt_p - max value exlusive
java.lang.Exception
public java.lang.String rand(java.lang.String startNum_p,
java.lang.String endNum_p,
java.lang.String precisionDigit_p)
throws java.lang.Exception
Example:
startInt_p - min value inclusiveendInt_p - max value exlusiveprecisionDigit_p - number of significant digit after decimal point. 0 for integer.
java.lang.Exception
public boolean randBool()
throws java.lang.Exception
java.lang.Exceptionpublic void seqout(java.lang.String seqText_p)
Example, "$seqout('myVar = [quot][curStateID][quot]')" will write the following to seq.out
myVar = "LoginPage"
if the current state id is at "LoginPage".
The alternative is to use <seqout> tag as follows to generate the same output in seq.out:
<seqout>
<output>
myVar = "[curStateID]"
</output>
</seqout>
seqText_p - text to be written to seq.out
java.lang.Exception - on any i/o error
public void push(java.lang.String varName_p,
java.lang.String value_p)
throws java.lang.Exception
Example, "$push('myStack', 'xx')" will push 'xx' to the end of list of values for 'myStack'. You will then use "$pop('myStack')" to retrieve the last value in the stack.
varName_p - name of the variable.value_p - value to be pushed to the stack.
java.lang.Exception - if the inconsitent use of the variable. That is, if the variable was previous used
as a single string variable.
public java.lang.String pop(java.lang.String varName_p)
throws java.lang.Exception
Example, "$pop('myStack')".
varName_p - name of the stack variable.
java.lang.Exception - on inconsistent use of the stack variable, for example the variable was
previously used as a single variable.
public java.lang.String peek(java.lang.String varName_p)
throws java.lang.Exception
Example, "$peek('myStack')" to retrieve the last value in the stack but does not pop the last value out of the stack.
varName_p - name of the variable.
java.lang.Exception - on inconsistent use of the stack variable, for example the variable was
previously used as a single variable.public void popAll(java.lang.String varName_p)
varName_p -
public java.lang.String increment(java.lang.String varName_p,
java.lang.String delta_p)
throws java.lang.Exception
Usage: <action code="$increment('countVar', '2')"/> increment var countVar by 2.
Specify negative number to decrement.
varName - variable namedelta_p - integer
java.lang.Exception
public java.lang.String increment(java.lang.String varName_p)
throws java.lang.Exception
Usage: <action code="$increment('countVar')"/>
varName_p - variable name
java.lang.Exception
public java.lang.String decrement(java.lang.String varName_p)
throws java.lang.Exception
Usage: <action code="$decrement('countVar')"/>
varName_p - variable name
java.lang.Exception
public java.lang.String trace(java.lang.String maxLogCount_p)
throws java.lang.Exception
Usage: place in onException or onError in <log> tag to print out trace of what sequence of states and transitions that led to the current state/transition where the error/failure occurred.
maxLogCount_p - max number of traversals
06:09:57.609:State Checkout(uid:104)
06:09:57.609:Transition ContinueShopping(uid:115)
06:09:57.656:State ProductList(uid:101)
java.lang.Exceptionpublic java.lang.String getPluginID()
public java.lang.String getBrowser()
public java.lang.String getBrowserVersion()
getBrowser()
public void sendMail(java.lang.String fromAddress,
java.lang.String toAddress,
java.lang.String subject,
java.lang.String messageText)
throws com.webmbt.MBTException
fromAddress - from address, if null passed, it will use the from address in system config for javaMailtoAddress - to addresssubject - subject textmessageText - message body text
com.webmbt.MBTExceptionpublic java.lang.String callURL(java.lang.String urlString_p)
urlString_p -
public java.lang.String execSQL(java.lang.String dbID_p,
java.lang.String sqlStmt_p,
java.lang.String colName_p,
java.lang.String delimeter_p)
throws java.lang.Exception
dbID_p - db id defined in mScript db tagsqlStmt_p - sql statement, insert, update, stored procedure call, etc.colName_p - name of the column to return, only used for select statement. pass "" for other statements.delimeter_p - row delimited to be used to seperate values from different rows, only used for select.
java.lang.Exception
public void sleep(java.lang.String millis_p)
throws java.lang.Exception
java.lang.Exception
public void addTagCheck(java.lang.String tag_p,
java.lang.String passed_p,
java.lang.String msg_p)
throws java.lang.Exception
tag_p - one single tag idpassed_p - "Y" or "pass" for passed, "N" or "fail" for failedmsg_p - message to be added to this check.
java.lang.Exception
public boolean evalGuard(com.webmbt.scxml.TransitionNode transObj_p)
throws java.lang.Exception
transObj_p -
java.lang.Exception
public void gotoState(java.lang.String gotoStateID_p)
throws java.lang.Exception
stateID_p - id of the goto state
java.lang.Exception - if unknown state
public void gotoTrans(java.lang.String gotoTransStateID_p,
java.lang.String gotoTransID_p)
throws java.lang.Exception
stateID_p - id of the source state of the new transitiontransID_p - id of the goto transition
java.lang.Exception - if unknown state/transitionpublic java.lang.String getSysConfig(java.lang.String propertyName_p)
propertyName_p - name of the property
public java.lang.String getSysConfig(java.lang.String propertyName_p,
java.lang.String defaultValue_p)
propertyName_p - name of the propertypublic boolean useSeqOutPlugin()
public SeqOutPlugin getSeqOutPlugin()
public void resetSeqNum()
public java.lang.String checkSeqNum()
Example: $checkSeqNum()
public void setSeqNum(java.lang.String seqNum_p)
Example: $setSeqNum('10') to set the sequence number to 10.
seqNum_p -
public boolean and(java.lang.String expr1_p,
java.lang.String expr2_p)
throws java.lang.Exception
Example: $and('[seqNum] gt 1', '[seqNum] lt 10'), which returns true when either seqNum var is greater than 1 and less than 10.
expr1_p - expr2_p -
java.lang.Exception
public boolean and(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
throws java.lang.Exception
Example: $and('[var2] ge [var3]','$getData('ds1','f1')','[var34] between [var1],[var2]')
expr1_p - expr2_p - expr3_p -
java.lang.Exception
public boolean or(java.lang.String expr1_p,
java.lang.String expr2_p)
throws java.lang.Exception
Example: $or('[seqNum] eq 1', '[seqNum] gt 10'), which returns true when either seqNum var is 1 or greater than 10.
expr1_p - expr2_p -
java.lang.Exception
public boolean or(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
throws java.lang.Exception
Example: $or('[var1] gt [var2]','[var10 lt [var3]','[var1] contains [var2]')
expr1_p - expr2_p - expr3_p -
java.lang.Exception
public boolean nor(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
throws java.lang.Exception
exprList_p - list of expressions in string array.
java.lang.Exception
public boolean nor(java.lang.String expr1_p,
java.lang.String expr2_p)
throws java.lang.Exception
java.lang.Exception
public boolean nand(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
throws java.lang.Exception
exprList_p - list of expressions in string array.
java.lang.Exception
public boolean nand(java.lang.String expr1_p,
java.lang.String expr2_p)
throws java.lang.Exception
java.lang.Exception
public boolean xor(java.lang.String expr1_p,
java.lang.String expr2_p,
java.lang.String expr3_p)
throws java.lang.Exception
exprList_p - list of expressions in string array.
java.lang.Exception
public boolean xor(java.lang.String expr1_p,
java.lang.String expr2_p)
throws java.lang.Exception
java.lang.Exception
public boolean compare(java.lang.String expr1_p,
java.lang.String op_p,
java.lang.String expr2_p)
throws java.lang.Exception
Example: $compare('[var1]','eq','[var2]') to compare the values in var1 and var2 and return the true if they are equal.
expr1_p - op_p - expr2_p -
java.lang.Exception
public boolean isTrue(java.lang.String expr_p)
throws java.lang.Exception
Example: $isTrue('[var2]')
expr1_p - any mScript expression
java.lang.Exception
public boolean isFalse(java.lang.String expr_p)
throws java.lang.Exception
Example: $isFalse('[var2]')
expr1_p - any mScript expression
java.lang.Exceptionnot(expr)
public boolean not(java.lang.String expr_p)
throws java.lang.Exception
Example: $not('[var2] eq $getData('ds1','f1')')
expr1_p - any mScript expression
java.lang.ExceptionifFalse(expr)
public java.lang.String ifTrueMsg(java.lang.String expr_p,
java.lang.String msg_p)
throws java.lang.Exception
Example: $ifTrueMsg('[var1] gt 5', 'variable var1 is greater than 5'), which returns the message 'variable var1 is greater than 5' when the variable 'var1' has a value greater than 5.
expr_p - msg_p -
java.lang.Exception
public java.lang.String ifFalseMsg(java.lang.String expr_p,
java.lang.String msg_p)
throws java.lang.Exception
Example: $ifFalseMsg('[var1] gt 5', 'variable var1 is greater than 5'), which returns the message 'variable var1 is greater than 5' when the variable 'var1' has a value greater than 5.
expr_p - msg_p -
java.lang.Exception
public java.lang.String chooseMsg(java.lang.String expr_p,
java.lang.String trueMsg_p,
java.lang.String falseMsg_p)
throws java.lang.Exception
Example: $chooseMsg('[var1] gt 5', 'variable var1 is greater than 5', 'variable var1 is less than or equal to 5'), which returns the message 'variable var1 is greater than 5' when the variable 'var1' has a value greater than 5, else it returns the second message.
expr_p - trueMsg_p - falseMsg_p -
java.lang.Exception
public java.lang.String evalExpr(java.lang.String expr_p)
throws java.lang.Exception
expr_p -
java.lang.Exception
public int evalExprToInt(java.lang.String expr_p)
throws java.lang.Exception
expr_p -
java.lang.Exceptionpublic java.util.HashMap<java.lang.String,java.lang.Object> getVarList()
public PluginMgr getPluginMgr()
public java.lang.String add(java.lang.String expr1,
java.lang.String expr2)
throws java.lang.Exception
Usage: <action code="$add('$getVar('a')', '2')"/>
expr1 - expr2 -
java.lang.Exception
public java.lang.String multiply(java.lang.String expr1,
java.lang.String expr2)
throws java.lang.Exception
Usage: <action code="$multiply('$getVar('a')', '2')"/>
expr1 - expr2 -
java.lang.Exception
public java.lang.String waitForVarChanged(java.lang.String varName_p)
throws java.lang.Exception
In concurrent modeling edition, since the transitions are executed concurrently, you this function can be used as communication between transitions (parallel execution of transitions).
varName_p -
java.lang.Exception
public java.lang.String waitForVarChanged(java.lang.String varName_p,
java.lang.String timeoutMillis_p)
throws java.lang.Exception
In concurrent modeling edition, since the transitions are executed concurrently, you this function can be used as communication between transitions (parallel execution of transitions).
varName_p - timeoutMillis_p - timeout in millis
java.lang.Exception
public java.lang.String waitForVarChanged(java.lang.String varName_p,
java.lang.String timeoutMillis_p,
java.lang.String newValue_p)
throws java.lang.Exception
In concurrent modeling edition, since the transitions are executed concurrently, you this function can be used as communication between transitions (parallel execution of transitions).
varName_p -
java.lang.Exception
public java.lang.String callFunc(java.lang.String funcName_p,
java.lang.String params_p)
throws java.lang.Exception
funcName_p - name of the user function. User functions are declared in MBT triggers.params_p - params in the format of p1=val1,p2=val2,... where p1,p2 are parameter names and val1 and val2
are the values for the parameters.
java.lang.Exception
public java.lang.String callFunc(java.lang.String funcName_p)
throws java.lang.Exception
funcName_p - name of the user function. User functions are declared in MBT triggers.
java.lang.Exception
public java.lang.String getFuncParam(java.lang.String paramName_p)
throws java.lang.Exception
This function always returns blank when is called from a non-state or transition context, e.g. in Mbt_start. Example: $getFuncParam('loginID')
paramName_p - name of the param.
java.lang.Exception
public java.lang.String listFuncParams()
throws java.lang.Exception
java.lang.Exception
public void setFuncReturn(java.lang.String retVal_p)
throws java.lang.Exception
retVal_p - return value
java.lang.Exception
public java.lang.String getTransData(java.lang.String fieldName_p)
throws com.webmbt.MBTException
fieldName_p -
com.webmbt.MBTException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||