Skip to main content

Manage Logic Source

To create and edit an entry file in the logic source. Entry files are used for building logic.

Create an Entry File

  1. In LOC Studio, go to LogicLogic Source.
Nav-source
  1. Under Logic Source, select the logic language.
Languages
  1. In the Source Explorer below, right-click on entry_files or one of the folders to create a generic or aggregator logic, or select a folder then click New File icon. (Create a new folder if necessary.)
Menu-source
or
FileAdd
Menu-add-file
warning

The language and logic type of an entry file cannot be changed after creation.

  1. Enter the entry file name (a file extension is required) then press Enter or click anywhere outside the input box.
Logic-source-create
  1. A new entry file with initial template should be created.

Edit an Entry File

You can save changes as much as you'd like on an entry file, which do not create new logic or affect existing ones.

You have to build from source to create or update a logic.

  1. Select an entry file and click Edit Edit on the top right.

  2. The code window will enter edit mode for modifying the source code. A "lock" icon Lock indicates that the entry file is currently locked from being edited by other users.

Edit Session

The logic source lock session will expire after some time of inactivity. LOC will prompt you to save before expiration.

If session expired and another user is editing the file, an "unable to save" Unable-save icon will be shown. Copy your code to somewhere else and try to save later.

  1. After making changes to the logic code, click Save Save to save the changes. When finished, click Close Cancel to close the editing mode.

  2. Or, click Save & Exit SaveExit to save and close the editing mode.

tip

You can also create a cloud logic first, although it will remain an empty logic until you build it with a source.

You can also right-click on the editor area and click New Event Schema to insert a code snippet for emitting an event using the Event Agent.

New-event-schema
New-event-schema-window

Rename an Entry File

Right-click on an entry file and select Rename. (If you are in the editing mode, close it first.)

Delete an Entry File

Select an entry file and click Delete Delete on the top right, or right-click the logic and select the same option. (If you are in the editing mode, close it first.)

info

If an entry file has been used to build at least one logic, deleting the entry file won't affect the built logic.

Manage Shared Modules

A logic source file created under shared_modules can be shared by other entry files. If a class or function (depending on languages) is imported in an entry file, the shared module file will be included in the logic building process.

See the tutorial Import Shared Modules for how to create and import shared modules.

Manage Project Files

A project file (which can be edited) should exist in each of the language's logic source:

Language/SDKFile
JavaScriptpackage.json
TypeScriptpackage.json
C#Logic.csproj

As the project files will be used to build logic, you can include third party packages, for example, from NPM (JavaScript/TypeScript) or NuGet (.NET).

If your LOC instance is required to run in a more secured environment (not allowed to connect external servers), offline package servers can be installed.