A really powerful feature of TeamMentor 3.3. is its ability to run CSharp Scripts included in the mapped UserData repository (script execution is powered by O2 Platform's FluentSharp APIs).
This blog post shows how it works
In an TM User data repository, add the H2Scripts folder
Inside that folder add a FirstScriptToInvoke.h2 file
NOTE: The reason for this special location is that this is where TeamMentor engine will look for the first script:
that should be compiled and executed:
as part of the TeamMentor Setup process:
Invoking First Script
The FirstScriptToInvoke.h2 file is basically a simple C# script:
That can be viewed/executed/tested via this TBot page:
Here are the current FirstScriptToInvoke.h2 script contents:
And the invocation result:
Testing/Coding Script
A good way to test this script, is to open a real-time log viewer (only available if running on Cassini)
Which is a windows Form Gui, that shows real-time log messages (the same log messages available via the Debug.aspx page or DebugInfo Tbot view):
Here is another execution of the original FirstScriptToInvoke.h2 script (note the compilation messages in the LogViewer):
For example, we can easily add messages to this log viewer, by adding these two lines to the FirstScriptToInvoke.h2 file:
which when re-executed (after refreshing the TBot page), will look like this:
To confirm that the FirstScriptToInvoke.h2 script does execute during startup, reload the cache and note the extra log entries:
Use online CSharp REPL to develop scripts to include in FirstScriptToInvoke.h2
When developing scripts it is easier to do them in the CSharp REPL included in the default install of TeamMentor.
You can access it by opening the /csharprepl url
which will redirect to:
and allow real-time REPL style coding: