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
- LOC Studio
- In LOC Studio, go to Logic ➞ Logic Source.
- Under Logic Source, select the logic language.
- 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.)
The language and logic type of an entry file cannot be changed after creation.
- Enter the entry file name (a file extension is required) then press
Enter
or click anywhere outside the input box.
- 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.
- LOC Studio
-
Select an entry file and click Edit on the top right.
-
The code window will enter edit mode for modifying the source code. A "lock" icon indicates that the entry file is currently locked from being edited by other users.
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" icon will be shown. Copy your code to somewhere else and try to save later.
-
After making changes to the logic code, click Save to save the changes. When finished, click Close to close the editing mode.
-
Or, click Save & Exit to save and close the editing mode.
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.
Rename an Entry File
- LOC Studio
Right-click on an entry file and select Rename. (If you are in the editing mode, close it first.)
Delete an Entry File
- LOC Studio
Select an entry file and click 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.)
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
- LOC Studio
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
- LOC Studio
A project file (which can be edited) should exist in each of the language's logic source:
Language/SDK | File |
---|---|
JavaScript | package.json |
TypeScript | package.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.