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) |
whch might display:
|
ghenry: Georgette Henry
|
$User properties represent attributes of a simulation user.
The first address line for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Address1
The second address line for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Address2
The contact city for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.City
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
The contact country for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Country
The contact email for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Email
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.
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) |
Example result:
Your account expired on 03-11-05. You may view old run information but may not start a new one.
The first name of the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.FirstName
The group of the user. Typically this is identical to $Group.
Example FML statement:
Subscription: $User.Subscription.Name
Example result:
Subscription: BusStrat 101
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.
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.
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.
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.
The last name of the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.LastName
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:
|
|
Example result:
|
|
The login id (username) of the user, as entered when the account was created in the Forio Broadcast manager.
Example FML statement:
$User.LoginId
Any notes about the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Notes
The phone contact info for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Phone
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
A list of $Run references for all runs simulated by the user.
Example FML to list all runs by the user:
|
|
Example result:
|
|
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.
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.
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
The state contact info for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.State
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
The zip or postal code contact info for the user, as entered in the Forio Broadcast manager.
Example FML statement:
$User.Zip