Class: Session

FVSessions.Session(id, mgr, settings, bindings)

new Session(id, mgr, settings, bindings)

Session Class Constructor function
Parameters:
Name Type Description
id String The id for this session, used for access and naming
mgr Object The owning FVSessions.Manager object
settings Object The source properties including connection which has connection details
bindings Object Any event/call forwarders
Source:

Methods

FVSESS.BindNewSession(fvApi, sessionKey)

Internal function that binds the FVTermParent events to the client's onnewscreen, onclose, onsend and onalert (when each handler is present) in support of the FVTermMsgApi.js module implemented September of 2023, this function is flagged async as the fvApi.GetCookieEx must run with an await to retain synchronicity in the messaging environment.
Parameters:
Name Type Description
fvApi Object Api Control Object
sessionKey String SessionKey if for active session
Source:

FVSESS.Close()

Close the Session if active
Source:

FVSESS.EnterScreen(enterKeys, onComplete)

Enter the active screen using a hllapi string
Parameters:
Name Type Description
enterKeys String Should be one or more keys with an enter/function/action key at the end like @E or @C ([enter] or [clear] or @T for Tabbing with ASCII host)
onComplete function Optional completion function for when the screen has been entered
Source:

FVSESS.GetScreenText(row, column, length) → {String}

Read from the active screen--will trim blanks from the text that is read-- Note that for MsgAPI you need to await this call to get the right value
Parameters:
Name Type Description
row Integer Row to read from where 1 is the first row
column Integer Column to read from where 1 is the first column
length Integer Length to read--if row/column is entry field this is ignored
Source:
Returns:
Text from the screen at row, column for length
Type
String

FVSESS.GetSessionKey() → {String}

Get the current session key from local storage
Source:
Returns:
Sessionkey or null if not found
Type
String

FVSESS.SaveSessionKey(sessionKey)

Save a sessionKey for this session to local storage
Parameters:
Name Type Description
sessionKey String SessionKey to save -- if null, the localstorage will be cleared
Source:

FVSESS.SetField(text, row, column) → {Boolean}

Set a field's value for MsgAPI use await to ensure synchronous operation
Parameters:
Name Type Description
text String Text to set into an unprotected entry field on the screen
row integer Row to set the text on starting with 1
column integer Column to set thet ext on starting with 1
Source:
Returns:
Function succeeded (MsgAPI only)
Type
Boolean

FVSESS.SetFocus(focusOn, activate) → {Promise}

Control if the session has focus - Note for MsgAPI need to await this if you want it to be synchronous
Parameters:
Name Type Description
focusOn boolean If true the session will have focus set, if false, focus will be off and locked off until
activate boolean If true, when focusOn is true, will also set browser focus into the FVTerm body set back on with this call
Source:
Returns:
For MsgAPI returns a Promise
Type
Promise

FVSESS.SetStatus(newStatus)

Set the status of the Session
Parameters:
Name Type Description
newStatus String Status which includes offline, started (needs logon) and ready (not on any logon screens)
Source:

FVSESS.SplitKeys(text) → {Object}

Split keys so that hllapi enters and function keys break into individual objects -- NOT SUPPORTED for MsgAPI=true
Parameters:
Name Type Description
text String Hllapi string with @ mnemonics (not [enter] style for now!)
Source:
Returns:
Array of strings where each has keys ending with an AID (enter/function)
Type
Object

FVSESS.Transactions(transactions, onComplete, bubble)

Send a set of keys to the session, should end with Enter or Function key
Parameters:
Name Type Description
transactions String Transactions to run separated by the vertical bar (|) -- grammar for each transaction:
  • F^row^column=move cursor to location;
  • H^enterKeys^waitForScreen= enterkeys that end with enter or function key and waitForScreen is a screen in the active application's definition file
  • I^keystrokes= keystrokes are a mix of text and @T for tab and so on (default action if no I^ is present at start of the transaction)
  • T^text^row^column=Enter text into an unprotected field at row and column where each starts with 1
  • S^milliseconds=Sleep for the milliseconds like S^2000 for 2 second sleep
  • W^milliseconds^waitForScreen=Sleep for the milliseconds like S^2000 for 2 second sleep but if screen comes in move on
Example: H^RMIS@E^RMIS|T^123456789^3^23|T^10081958^5^23|H^@E^RMIM will enter the transaction "RMIS" then wait for a screen identified as RMIS; then it will key "123456789" at a field at row 3 column 23; then a field "10081958" at row 5, column 23; then will send an ENTER and wait again for RMIS to appear
onComplete function Optional completion function for when the transactions are completed
bubble boolean Set true for screen updates to be bubbled to the onload
Source:

FVSESS.TypeAtRowCol(text, row, column)

Type text starting at a row and column - if length of text exceeds first field will autoskip to next NOT SUPPORTED FOR MsgAPI=true
Parameters:
Name Type Description
text String Text to type into unprotected entry field(s) on the screen
row integer Row to type the text on starting with 1
column integer Column to type the text on starting with 1
Source:

FVSESS.TypeKeys(text, screenWaiter) → {boolean}

Type HLLAPI string starting at current row and column NOT SUPPORTED for MsgAPI=true
Parameters:
Name Type Description
text String Text to type into unprotected entry field(s) on the screen, can include @T for tab and end with @E or other AID string, which will be sent to the host for processing
screenWaiter function Provides callback instead of onLoad
Source:
Returns:
Keys were typed OK
Type
boolean

FVSessions.SetLocalMethods()

Internal use only function used to set functions when FVSessions.config.msgAPI is false
Source:

FVSessions.SetMsgMethods()

Internal use only function used to set functions when FVSessions.config.msgAPI is true
Source: