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 Moxie 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
Moxie Installation You must have installed Moxie and have the prerequisites for developing delegates for Moxie.
Tutorial Project You must start this section with the delegate module project template from the Moxie installation: \documentation\tutorialFiles\03\DelegateModules\UAVMissionDelegateModule
Recommended Reading Before completing this section, you may want to read the following help topics:

Instructions

You can use any Java Integrated Development Environment (IDE), such as IntelliJ IDEA or Eclipse, to develop, build, and install your delegate modules. For simplicity, this tutorial only covers running Gradle from the Command Prompt.

Configure the delegate module

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

  1. If you you have not yet set the DelegateModuleHomePath for your environment, then configure your delegate module home directory now (e.g., C:\Moxie\DelegateHome).
  2. Copy the delegate module project template from the Moxie installation to a preferred location on your local machine (e.g., C:\Moxie).
  3. In the new UAVMissionDelegateModule directory, open the gradle.properties file.
  4. Set the com.agi.moxie.installDir property to the path to your Moxie installation (e.g., C:/Users/<username>/Documents/Moxie).
  5. Set the com.agi.moxie.delegateModuleDir property your delegate module home directory (e.g., C:/Moxie/DelegateHome).
  6. Set the com.agi.moxie.stkInstallDir property to the path to your STK installation (C:/Program Files/AGI/12 by default).
  7. Set the com.agi.moxie.noMagicInstallDir and com.agi.moxie.noMagicPropFileName properties to the corresponding values for your No Magic modeling tool. The following table lists the default directory and properties file name for each No Magic modeling tool:
    No Magic Modeling Tool Default Installation Directory Default Properties File Name
    Cameo Enterprise Architecture C:/Program Files/Cameo Enterprise Architecturecameoea.properties
    Cameo Systems Modeler C:/Program Files/Cameo Systems Modelercsm.properties
    MagicDraw C:/Program Files/MagicDrawmagicdraw.properties
  8. Save and close the file.

Build and install the delegate module

  1. Open a Command Prompt (cmd) and enter cd C:\Moxie\UAVMissionDelegateModule, replacing the path to your delegate module project as necessary.
  2. Enter gradle install to assemble the delegate module and install it for Moxie. After the build completes, confirm that there were no errors.
  3. To view the installed delegate module JAR file, in File Explorer, open the com.agi.moxie.tutorial.uavmission directory inside your delegate module home directory (e.g., C:\Moxie\DelegateHome\com.agi.moxie.tutorial.uavmission).

Next Section >