Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Script Tasks in FrameworkX are a powerful feature that allows for The Scripts Module allows the automation of various tasks through scripting. They support code written in C#, VB.NET, and Python, offering a versatile platform for executing custom automated operations within the application. These tasks can be configured You can configure these tasks to run in response to specific events or on a scheduled basis, enhancing the application's efficiency and functionality.  Script tasks can be self-contained lines of code, call Script Classes ScriptTasks can also call ScriptClasses or use external DLLs.

On this page:

Table of Contents
maxLevel3
stylenone

Tip
titleSolution Example

Scripts Examples



Image Added

Configuring ScriptTasks

ScriptTasks

Configuring Tasks

Tasks are program units , written in VB.NetNET, C#, or Python , that execute either when a trigger event occurs or periodocally at specified intervals. FactoryStudio includes periodically at specified intervals. To create and configure a ScriptTask, follow the steps below:

  1. Access Scripts → Tasks.
  2. Click on the plus icon.
  3. Input a task name and description, and select the desired language.
  4. Choose to either create a new code or import one from an existing library.
  5. Click Ok.

Now, you can double-click the newly created row to access the Code Editor, where you can insert the code for the ScriptTask.

Info

To edit a property of an existing ScriptTask, click the desired property to select it and click it again after a second to edit it. See a list of available properties in the next section.

The image below illustrates the process described above.

Image Added

Built-in ScriptTasks

All solutions include the following built-in tasksScriptTasks:

  • ServerStartup—Executed Server Startup: Executed when the project solution starts running. Runs on the server (computer running TServer.exe).
  • ServerShutdown—Executed Server Shutdown: Executed when the project solution shuts down. Runs on the server.
  • ClientStartup—Executed Client Startup: Executed on each client when the Displays module (TVisualizeris activate on Windows (TRichClient.exe/TSmartClient.exe) starts runningor  on  a WebClient (HTML5).
  • ClientShutdown—Executed Client Shutdown: Executed on each client when the Displays module Client closes.
To configure tasks:
  • Go to Scripts > Tasks.
  • Select a task name, or select the insert row (first row) to create a new task.
  • Enter or select information, as needed.


Note

"Exit Function" can be used in VB.NET script tasks to stop the code of the currently running task.



ScriptTasks Configuration Tables

The following is a table describing each available property field for ScriptTasks Configuration Table.

Info

If a property column is not visible on the grid, enable it by right-clicking the grid header and selecting it from the list.


Property

Description

ID

Identifies the unique identifier of the ScriptTask object.

VersionID

Represents the modification version of the ScriptTask, which increments with each modification related to this object.

Name

Specifies the name assigned to the ScriptTask.

Code

Defines the programming language used for the ScriptTask.

Domain

Specifies where the script executes, either on the Client system locally or on the Server globally.

Trigger

Identifies the event that triggers the ScriptTask.

Period

Sets the interval for periodic execution of the task.

InitialState

Indicates if the task is initially Enabled (ready to run) or Disabled (not ready to run).

Lines

Displays the code lines for the ScriptTask.

EditSecurity

Controls the permissions for editing the ScriptTask.

BuildStatus

The task code's status results

Column

Description

Name

Enter a name for the task. The system lets you know if the name is not valid.

Code

Read-only. This specifies the language used for the code for this task. By default, this is the language you 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 other object) that should trigger the task execution, if any. The task executes when the value of the object changes.

Period

Enter the time interval that should occur between executions of the task, if there is no trigger.

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 task's initial state:

  • Enabled—Task is ready to run.
  • Disabled—Task is not ready to run. You may enable the task under specific conditions.

BuildStatus

Read-only. Status of the task code

from the continuous compiling process.

Green check

mark—Task

mark: The task runs without errors.

Red

X—Task

X:Thetask has warnings or errors

. Double

, double-click to

go to

access the warning or error.

Warnings are information only.

Errors will prevent the code from running for that specific task. The rest of the

application

solution will run.

BuildErrors

Read-only. Displays any

Lists the number of errors encountered during the

last build.

EditSecurity

Set the security to enable who can edit the tasks.

Description

Enter a description of this task.

[Other columns]For definitions of other columns that are available in this table, see Common Column Definitions.

build process.

BuildMessage

Provides messages related to the build process.

Category

Groups the ScriptTask into a specific category.

LockState

Indicates if the ScriptTask is locked for editing.

LockOwner

Displays the user who owns the lock on the ScriptTask.

DateCreated

Records the date and time when the ScriptTask was created.

DateModified

Shows the date and time of the last modification to the ScriptTask.

Description

Describes the purpose and functionality of the ScriptTask.



In this section:

In this section...

Page Tree
root@parent
spacesV10