Java Logic Files and Categories

There are two types of Java files in Fabric Studio: one is dedicated to developing Java functions, and the other is for creating Globals variables. In Fabric Studio, the term Logic Category Files refers to a Java package that stores the Logic.java file. The Logic.java file contains all the Java functions defined under the Logic Category. While several Java files can reside in a category/package, only a single Logic file shall exist there.

Although the functions are presented in the Project Tree as separate files, they are stored under a single file, called Logic.java, within the selected category.

Shared Java Files

Java files that reside on a shared level can be inherited by any project components, for example, Web Services, References, or Logical Units, and can be shared throughout a project. It is highly recommended to avoid duplicating names of Shared Objects at lower levels of a project, for example, within a Logical Unit component. However, if there are duplicate object file names, the file residing under the specific lower-level component takes priority upon execution. A Java file, which resides on a Shared Objects level, has 2 out-of-the-box Java template files:

Designated Java Files

Designated Logic.java files are files assigned to their levels of definition; such levels can be either References, Web Services, or Logical Units. The Globals.java file is automatically created under either the References or each Logical Unit.

How Do I Associate a Function with a Category?

When creating a new Java function, it must be associated with a category such as Built-in or Product. Each category has multiple subcategories, such as Date or Math, that contain the most common types of functions for that subcategory.

  • If the category does not exist, then a new Logic.java file will be created, and the function will be associated with it.
  • When the category exists, the new function would be associated with the existing Logic.java file.
  • If a new category name is entered into the Category setting, a new category will be created, and the function will be associated with the new Logic.java file. Each category creates a separate Logic.java file, which has a specific path, thereby differentiating it from other files in other categories. Click for more information about Project Functions.

Notes

  • Export / Import can be implemented on a Java file level. To copy only one function from one category to another category or project, copy and paste the function’s code.
  • Version control is managed on a Logic.java file level and not on a function level.
  • Functions can be edited from IntelliJ by pressing Ctrl+I in a function in the Fabric Studio to activate IntelliJ. Fabric Studio enables you to open the source file.

How Do I Create a Category?

Go to the Project Tree, right-click Java, and click New SharedLogic Category File / New Logic Category File. Note that when creating a new function, you should enter a new category name, which would automatically create a new category folder.

How Do I Create a Category?

Creating a new category is intended to create a new Logic Java file. It can be done by following these steps:

  1. Go to the Project Tree and navigate to the required location, either a Logical Unit or Shared Objects.
  2. Right-click src under the Java folder, and
  3. Choose New Java Logic File
  4. In the open pop-up window, type the name of the category/package
  5. A new package folder will be created, containing a Logic file template with the package name already set.
Previous
Previous

Java Logic Files and Categories

There are two types of Java files in Fabric Studio: one is dedicated to developing Java functions, and the other is for creating Globals variables. In Fabric Studio, the term Logic Category Files refers to a Java package that stores the Logic.java file. The Logic.java file contains all the Java functions defined under the Logic Category. While several Java files can reside in a category/package, only a single Logic file shall exist there.

Although the functions are presented in the Project Tree as separate files, they are stored under a single file, called Logic.java, within the selected category.

Shared Java Files

Java files that reside on a shared level can be inherited by any project components, for example, Web Services, References, or Logical Units, and can be shared throughout a project. It is highly recommended to avoid duplicating names of Shared Objects at lower levels of a project, for example, within a Logical Unit component. However, if there are duplicate object file names, the file residing under the specific lower-level component takes priority upon execution. A Java file, which resides on a Shared Objects level, has 2 out-of-the-box Java template files:

Designated Java Files

Designated Logic.java files are files assigned to their levels of definition; such levels can be either References, Web Services, or Logical Units. The Globals.java file is automatically created under either the References or each Logical Unit.

How Do I Associate a Function with a Category?

When creating a new Java function, it must be associated with a category such as Built-in or Product. Each category has multiple subcategories, such as Date or Math, that contain the most common types of functions for that subcategory.

  • If the category does not exist, then a new Logic.java file will be created, and the function will be associated with it.
  • When the category exists, the new function would be associated with the existing Logic.java file.
  • If a new category name is entered into the Category setting, a new category will be created, and the function will be associated with the new Logic.java file. Each category creates a separate Logic.java file, which has a specific path, thereby differentiating it from other files in other categories. Click for more information about Project Functions.

Notes

  • Export / Import can be implemented on a Java file level. To copy only one function from one category to another category or project, copy and paste the function’s code.
  • Version control is managed on a Logic.java file level and not on a function level.
  • Functions can be edited from IntelliJ by pressing Ctrl+I in a function in the Fabric Studio to activate IntelliJ. Fabric Studio enables you to open the source file.

How Do I Create a Category?

Go to the Project Tree, right-click Java, and click New SharedLogic Category File / New Logic Category File. Note that when creating a new function, you should enter a new category name, which would automatically create a new category folder.

How Do I Create a Category?

Creating a new category is intended to create a new Logic Java file. It can be done by following these steps:

  1. Go to the Project Tree and navigate to the required location, either a Logical Unit or Shared Objects.
  2. Right-click src under the Java folder, and
  3. Choose New Java Logic File
  4. In the open pop-up window, type the name of the category/package
  5. A new package folder will be created, containing a Logic file template with the package name already set.
Previous
Previous