$User

The $User reference represents information about the current user, such as the login id and name.  Users are created in the Forio Broadcast manager.  They may be part of a Subscription group, and may be licensed to expire after a certain number of runs or after a certain date.

About Facilitator Subscriptions and User Accounts

$User references can also be retrieved via other properties such as $Sim.EndUsers, $Subscription.EndUsers, and $Run.EndUser.  The first two references return a list of $User references.  The phrase "EndUser" is used to distinguish between simulation users and other types of Broadcast users (such as developers).  For example, to list the names of all users in the subscription group you would enter the following FML:

 

#foreach($u in $Subscription.EndUsers)
$u.LoginId: $u.FirstName $u.LastName
#end
 

 

whch might display:

 

ghenry: Georgette Henry
jsmith: John Smith
awilliams: Allison Williams

 

 

$User Properties

$User properties represent attributes of a simulation user.

Address1

The first address line for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Address1

Address2

The second address line for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Address2

City

The contact city for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.City

CompletedScores

A list of run objects representing runs by this user, sorted in descending order of Score.  For all runs sorted by score, see Scores.  For all runs sorted by score, see Scores.

Example FML statement:

#foreach($r in $User.CompletedScores)
Run $foreachCount by $r.EndUser.FirstName $r.EndUser.LastName with score $r.Values.get("Score")|
#end

Example result:

Run 1 by Jeff Smith with score $110,255
Run 2 by Jeff Smith with score $55,211
Run 3 by Jeff Smith with score $21,567

The company for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Company

Country

The contact country for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Country

Email

The contact email for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Email

ExpirationDate

The date that the user's account expires, or null if no expiration date is set.

Example FML statement:

Your account will expire on $Formatter.date($User.ExpirationDate).

Example result:

Your account will expire on 03-11-05.

Expired

True if the user's account has expired.  This might be due to exceeding the licensed number of runs or going past the expiration date.  This is also true if it is past the group expiration date or the group has exceed its number of runs.  

Example FML statement:

 

#if ($User.Expired)
Your account expired on $Formatter.date($User.ExpirationDate).  You may view old run information but may not start a new one.
#end
 

 

Example result:

Your account expired on 03-11-05.  You may view old run information but may not start a new one.

FirstName

The first name of the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.FirstName

Group

The group of the user.  Typically this is identical to $Group.

Example FML statement:

Subscription: $User.Subscription.Name

Example result:

Subscription: BusStrat 101

IsFacilitator

True if the user is a facilitator, and false if the user is an ordinary end user.

Example FML statement:

#if($User.IsFacilitator)You are the facilitator.#end

Example result:

You are the facilitator.

IsLicensedByRuns

True if the simulation is licensed by runs, false otherwise.

Example FML statement:

#if($User.IsLicensedByRuns) You have used $User.RunsUsed runs. #end

Example result:

You have used 10 runs.

LastAccess

The date and time the user last clicked on a simulation page.  

Example FML statement:

$User.LoginId last clicked on a page link on $Formatter.date($User.LastAccess) at $Formatter.time($User.LastAccess).

Example result:

jsmith last logged in on 03-25-2004 at 11:15 PM.

LastLoggedIn

The date and time the user last logged into the simulation.  

Example FML statement:

$User.LoginId last logged in on $Formatter.date($User.LastLoggedIn).

Example result:

jsmith last logged in on 03-25-2004.

LastName

The last name of the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.LastName

ListedRuns

A list of $Run references for all runs simulated by the user with the property $Run.Listed set to true

Example FML to list all runs by the user:

 
#foreach($r in $User.ListedRuns)
Run $foreachCount started at $r.Created and ran $Run.SimStep steps.
#end
 

 

Example result:

 
Run 1 started at Wed Jan 03 11:02:00 and ran 10 steps
Run 2 started at Wed Jan 03 11:20:11 and ran 2 steps.
Run 3 started at Wed Jan 03 11:25:33 and ran 5 steps.
 

LoginId

The login id (username) of the user, as entered when the account was created in the Forio Broadcast manager.

Example FML statement:

$User.LoginId

Notes

Any notes about the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Notes

Phone

The phone contact info for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Phone

Role

An identifier to indicate the role that the user belongs to in a multiplayer simulation.  Typically, this is an integer which refers to an array subscript within the Forio model (e.g. "1") but it can be any text (e.g. "blueteam").  

Example FML statement:

$User.Role

Runs

A list of $Run references for all runs simulated by the user.

Example FML to list all runs by the user:

 
#foreach($r in $User.Runs)
Run $foreachCount started at $r.Created and ran $Run.SimStep steps.
#end
 

 

Example result:

 
Run 1 started at Wed Jan 03 11:02:00 and ran 10 steps
Run 2 started at Wed Jan 03 11:20:11 and ran 2 steps.
Run 3 started at Wed Jan 03 11:25:33 and ran 5 steps.
 

RunsLicensed

The total number of runs licensed to the user, if applicable.

Example FML statement:

You have used $User.RunsUsed of $User.RunsLicensed total runs licensed.

Example result:

You have used 30 of 500 total runs licensed.

RunsUsed

A counter of the total number of runs used.  Incremented every time the user steps for the first time in a run.  If the user is licensed by runs and this number is greater than RunsLicensed, the user will not be permitted to start new runs.

Example FML statement:

You have used $User.RunsUsed of $User.RunsLicensed total runs licensed.

Example result:

You have used 30 of 500 total runs licensed.

Scores

A list of run objects representing runs by this user, sorted in descending order of Score.  For completed runs only, see CompletedScores.

Example FML statement:

#foreach($r in $User.Scores)
Run $foreachCount by $r.EndUser.FirstName $r.EndUser.LastName with score $r.Values.get("Score")|
#end

Example result:

Run 1 by Jeff Smith with score $110,255
Run 2 by Jeff Smith with score $55,211
Run 3 by Jeff Smith with score $21,567

State

The state contact info for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.State

Team

An identifier to indicate the role that the user belongs to in a multiplayer simulation.  Obsolete - recommended to use $User.Role instead.  $User.Team returns the same value as $User.Role.

Example FML statement:

$User.Team

Zip

The zip or postal code contact info for the user, as entered in the Forio Broadcast manager.

Example FML statement:

$User.Zip