Project Organization

Regardless of what IDE you use, you should set up your project directory first. You can put the directory for your delegate source code anywhere, but it typically makes sense to keep it alongside your No Magic project file, the location you want to deploy your built delegate module to, and any other project-related files like an Ansys Systems Tool Kit® (STK®) application scenario. Figure 1 shows this organization for the completed tutorial sample included in the Behavior Execution Engine installation.

Figure 1: The tutorial sample project directory

Inside your delegate source code directory, you should also follow the pattern used by the samples:

Figure 2: The tutorial sample delegate source code directory

  1. To set up an environment for development, you can copy the contents of the samples\build directory from the Behavior Execution Engine installation into your delegate source code directory. After you later create a delegate provider for your module, copy its fully qualified name into the \resources\META-INF\services\com.agi.moxie.spi.DelegateProvider file.
  2. Import your project into your IDE, using the instructions in the developer environment section, and then return here to finish configuring Gradle.
  3. In your IDE, open the gradle.properties file.
  4. Set the com.agi.moxie.installDir property to the path to your Behavior Execution Engine installation (e.g., C:/Users/<username>/Documents/Behavior Execution Engine).
  5. Set the com.agi.moxie.delegateModuleDir property to the location you want to deploy your delegate module to. This should be a project-relative directory (e.g., ../delegates) or your delegate module home directory (e.g., C:/BehaviorExecutionEngine/DelegateHome).
  6. If you plan to use STK classes in your delegates, set the com.agi.moxie.stkInstallDir property to the path to your STK installation (C:/Program Files/AGI/STK_ODTK 13 by default); otherwise, you can ignore this property.

    Ansys Systems Tool Kit® (STK®) application-related features are only available if you acquired Behavior Execution Engine as part of the STK Enterprise application or otherwise have a valid license for the STK application. If you acquired Behavior Execution Engine as part of the Ansys ModelCenter® Enterprise application but have access to a valid STK license, contact us for access to the STK application-related features.

  7. Save the file, if your IDE does not do that automatically, and close it.
  8. Open the settings.gradle file.
  9. Set the rootProject.name property to the name of your delegate module project.
  10. Save the file, if your IDE does not do that automatically, and close it.

You should now be ready to start writing delegates. The Gradle build script provides one task in particular that you should be aware of: