Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:hybrid_model [2020/12/31 02:55]
admin [Generate Test Cases]
tutorial:hybrid_model [2020/12/31 17:22]
admin [Generate Test Cases]
Line 162: Line 162:
 To write a line of script in TRIGGER for transition "CheckOut", select script context menu for transition "CheckOut": To write a line of script in TRIGGER for transition "CheckOut", select script context menu for transition "CheckOut":
  
-{{wiki:overview:tut_DataSet_menuTransScript.png?200}}+{{wiki:overview:tut_DataSet_menuTransScript.png?250}}
  
 +IDE should navigate to //SCRIPT// tab.  Since the TRIGGER for transition "CheckOut" has not been created, you will be prompted to create it:
  
 +{{wiki:overview:tut_DataSet_ScriptAddDialog.png?500}}
 +
 +Click "OK" to create the skeleton TRIGGER script for the transition:
 +
 +{{wiki:overview:tut_DataSet_ScriptCheckOut.png?500}}
 +
 +Alternatively you can add the skeleton TRIGGER script for the transition by pressing Ctrl-I while your cursor is placed on a blank line in //SCRIPT// tab and select transition "CheckOut":
 +
 +{{wiki:overview:tut_DataSet_AddTrigger.png?100}}
 +
 +
 +
 +TRIGGER script is just a //groovy// function, go ahead and add two lines of scripts as show below:
 +
 +{{wiki:overview:tut_DataSet_TriggerCheckOut.png?500}}
 +
 +
 +The "log" scripts above prints the current row of the data set and "Payment Type" and "CardNum" to //Script Log//.
 +
 +Save the changes and run the model again. Examine //Script Log// (click on the script log button {{wiki:overview:tut_DataSet_ScriptLogBtn.png?50}} in //RESULT// tab):
 +
 +Below is the first few lines from the script log:
  
    C:\eclipse-workspace\TestOptimal_Dev\model\Demo_DataSet.fsm\temp\script.log    C:\eclipse-workspace\TestOptimal_Dev\model\Demo_DataSet.fsm\temp\script.log