Scripts and .NET Framework > Configuring Tasks
  
Configuring Tasks
Tasks are code, written in either VB.Net or CSharp, that execute based on process events, either when the trigger event occurs or at every interval defined in the Period column.
FactoryStudio comes with the following built-in tasks:
ServerStartup—Executed when the project starts running. Runs on the server (computer running TServer.exe).
ServerShutdown—Executed when the project shuts down. Runs on the server.
ClientStartup—Executed on each client when the TVisualizer.exe (Displays module) starts running.
ClientShutdown—Executed on each client when the Display module closes.
To configure tasks:
1. Go to Edit > Scripts > Tasks.
2. Enter or select information, as needed.
 
Column
Description
Name
Enter a name for the task. The system lets you know if the name is not valid.
Code
Read-only. This defaults to the language selected when you created the project. From the Code Editor tab, you can change the code language. To change the project default, go to Info > Settings.
Trigger
Enter or select the event (tag or object) that triggers the task execution. The task executes when the value of the object changes.
Period
Enter how often the task should execute.
Domain
Select where the script executes:
Client—Task executes on each client system. These are tasks that apply locally (on the user’s computer), for example, report generation.
Server—Task executes on the server system. These are tasks that apply across the application, that is, globally.
InitialState
Select the tasks’s initial state:
Enable—Task is ready to run.
Disabled—Task is not ready to run. Lets you enable the task under specific conditions.
BuildStatus
Read-only. Status of the task code from the continuous compiling process.
Green check mark—Task runs without errors.
Red X—Task has warnings or errors. Double-click to go to the warning or error. Warnings are information only. Errors will prevent the code from running, but only that specific task. The rest of the application will run.
BuildErrors
Read-only. Displays any errors encountered during the last build.
Description
Enter a description of this task.
3. Enter the code for the task.
Double-click the row to access the Code Editor tab. See Working with the Code Editor.
4. Click Save.