Creating a Delegate Module

Overview

A delegate is a Java interface or class that uses custom code to implement the properties and operations of its corresponding SysML block. A delegate module is just a JAR file containing a group of delegates for Behavior Execution Engine to use as it executes a simulation. In this section, you will configure a delegate module project template for your environment and then build and install a delegate module JAR file for the UAV mission. Since you will not have written any delegates, the JAR file will not do anything yet. You will simply have verified that you are set up to start writing custom delegates.

This section covers the following concept:

Prerequisites

Prerequisite Description
Behavior Execution Engine Installation You must have installed Behavior Execution Engine and have the prerequisites for developing delegates for Behavior Execution Engine.
Tutorial Project You must start this section with the delegate module project template from the Behavior Execution Engine installation: \documentation\tutorialFiles\03\DelegateModules\UAVMissionDelegateModule
Recommended Reading Before completing this section, you may want to read the following help topics:

Instructions

Before completing these steps, you may want to install a Java Integrated Development Environment (IDE) such as Eclipse, IntelliJ IDEA, or VS Code to make developing delegates and building with Gradle easier. If you do not want to use an IDE, you can still build with Gradle through a Command Prompt.

Configure the delegate module

You need to configure Gradle properties so that the build script can find all the Behavior Execution Engine, STK, and No Magic files that it needs.

  1. If you have not yet set the DelegateModuleHomePath for your environment, then configure your delegate module home directory now (e.g., C:\BehaviorExecutionEngine\DelegateHome).
  2. Copy the delegate module project template (the UAVMissionDelegateModule directory) from the Behavior Execution Engine installation to a preferred location on your local machine (e.g., C:\BehaviorExecutionEngine).
  3. If you are using an IDE, you should import your new delegate module into Eclipse, IntelliJ IDEA, or VS Code now.
  4. In the new UAVMissionDelegateModule directory, open the gradle.properties file.
  5. Set the com.agi.moxie.installDir property to the path to your Behavior Execution Engine installation. If you don't know where it is installed, you can open the Behavior Execution Engine Installation Directory directly from the Windows Start menu or Taskbar search box.
  6. Set the com.agi.moxie.delegateModuleDir property to the path to your delegate module home directory (e.g., C:/BehaviorExecutionEngine/DelegateHome).
  7. Set the com.agi.moxie.stkInstallDir property to the path to your STK installation (C:/Program Files/AGI/STK 12 by default).
  8. Save and close the file.

Build and install the delegate module

  1. If you are using an IDE, run the Gradle install task in your IDE to assemble the delegate module and install it for Behavior Execution Engine.
  2. If you are not using an IDE, open a Command Prompt (cmd) and enter cd C:\BehaviorExecutionEngine\UAVMissionDelegateModule, replacing the path to your delegate module project as necessary. Then enter gradle install in the Command Prompt.
  3. After the build completes, confirm that there were no errors. To view the installed delegate module JAR file, in File Explorer, open the sample-tutorial-uav-mission directory inside your delegate module home directory (e.g., C:\BehaviorExecutionEngine\DelegateHome\sample-tutorial-uav-mission).

Next Section >