Versions Compared

Key

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

Overview

Script Classes in FrameworX are custom methods that can be called from Tasks, Expressions or Displays. Written in C#, VB.NET, or Python, these classes enable users to develop functionalities that can be  used multiple times throughout the soluiton.

On this page:

Table of Contents
maxLevel3

Configuring Classes

Classes let you

allow you to create a repository of class libraries, methods, and functions that you can use across the application. You can call them from tasks, other classes, and

displays (

the display's code behind

)

functionality.  

On this page:

Table of Contents
maxLevel3


Configuring Script Classes

To create and configure a new Script Class follow the steps below:

  1. Access Scripts > Classes
  2. Click on the plus icon.
  3. Input a class name and description, select the desired language and choose the domain of the class.
  4. Choose to either create a new code or import one from an existing library.
  5. Choose the content type for the class.
  6. Click Ok.

Now,

FactoryStudio comes with the following built-in classes:

  • ServerMain—Methods library available for all server tasks.
  • ClientMain—Methods library available for all clients.

To configure classes:

  • Go to Scripts > Classes.
  • Select a class name, or select the insert row (first row) to create a new class.
  • Enter or select information, as needed.
  • Then

    you can double-click

    on

    the newly created row

    created

    to

    go to Code Editor.

    access the Code Editor, where you can insert the code for the Script Class.

    Info

    To edit a property of an existing Script Task, 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 classes

    All soutions include the following built-in classes:

    • Server Main: The methods library available for all server tasks.
    • Client Main: The methods library available for all clients.

    Scipt Classes properties

    The following is a table describing each available property field for script classes:

    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.


    Click Save
    Read-only. Show the (ie.: method or namespace)Set the BuildOrderSet the Read-only. mark—Class X—Class . Double go to class application |Read-only. Enter a .

    Property

    Description

    Name

    The name of the class.

    Code

    Specifies

    Column

    Description

    Name

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

    Code

    Read-only. This specifies the language used for the code for of this taskClass. By default, this is the language you selected when you created the project. From the Code Editor tab, you You can change the code language. To change the project default , go to by accessing Info > Settings.

    DomainSelect

    The location where the class executes, there are two options:

    Client—Class
    • Client: Task executes on each client system. These are
    classes
    • tasks that apply locally (on the user's computer)
    . For example, report generation
    • .
    Server—Class
    • Server: Task executes on the server system. These are
    classes
    • tasks that apply across the application, that is, globally.
    |

    Content

    The type of the content in the class

    .

    Edit Security

    The

    EditSecurity

    security to enable who can edit the tasks.

    Build Order

    The order to build the classes.

    Build Status

    The

    BuildStatus

    Status of the class code from the continuous compiling process.

    • Green check
    • mark: The task runs without errors.
    • Red
    • X: The task has warnings or errors
    • , double-click 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
      • solution will run.

    Build Errors

    BuildErrors

    Displays any errors encountered during the last build.

    Description

    The description of this class

    [Other columns]For definitions of other columns that are available in this table, see Common Column Definitions.
  • Apply all namespaces that will be used in your code, e.g.
    • “Using System”
    • “System.IO.StremReader”
  • .


     

    In this section...

    Page Tree
    root@parent
    spacesV10