Skip to main content

Flex Package Management

Writing Flex Code?

To learn about the Flex language syntax see Flex Docs

Package Manager

The Package Manager holds all of your Flex packages. From here you can open, create, fork and delete packages.

The packages that you have access to include:

  • Packages provided by Tangram Pro (e.g. OpenUxAS::LMCP::v3)
  • Packages provided by any teams that you are a member of
  • Packages you create

Create Packages

Packages can be created from the Package Manager by clicking the New Package button.

  • Package Name must begin with a letter and include a two-colon delimiter :: like namespace::packagename. It may contain letters, numbers and two-colon delimiters
  • Package Owner can be a team if you want to share the package with your team members, otherwise select You

Package Manager

Delete Packages

Packages that you own can be deleted from the Package Manager by clicking on a package you wish to delete, and clicking the Delete Package button.

caution

Deleting a package will impact all the projects that it has been added to, and remove its messages from project designs.

Fork Packages

Packages can be forked from the Package Manager by clicking on the package you wish to fork, selecting the new package owner, and clicking the Fork Package button. Forking transfers ownership, so the new package owner must be different from the current owner.

Export Packages

Packages can be exported as a zip file that contains all of the package's .flex files. This allows you to move your custom Flex packages between Tangram Pro instances as needed.

  1. Open the Package Manager
  2. Click the Details link beside the package you want to export
  3. Click the Download Package button

Import Packages

Packages that were exported from one Tangram Pro instance can be imported into another instance.

  1. Open the Package Manager
  2. Click the Import button and select an exported package's zip file

Editing Packages

Packages can be edited on the master branch. You can create folders and files using the buttons beside the package name, and rearrange them by dragging and dropping.

Flex Files

.flex extension

Flex files must end with .flex. For example: msgs.flex. This will provide Flex code highlighting and realtime typechecking.

Module Names

After creating a new file, you'll see the module name declared automatically at the top:

module packageName.fileName

If it is inside a folder, the module name will look like:

module packageName.folderName.fileName

Dependecies

Packages can access other packages by adding a dependency. Click the Dependencies button above your package, search for a package and click Apply Changes. After a dependency is added, you can include import statements in your files to access specific objects.

Import Statements

A Flex file can import another Flex file in order to access its objects. Import statements are entered below the module name.

Import a module with an alias:

import moduleName as alias

Example: Let's say you have a package named JM::NewPkg and a file named msgs.flex. You can import it like this:

import JM::NewPkg.msgs as msgs

// any references to msgs objects need to be prefixed with msgs
// a struct from msgs named 'Location' can be accessed like this:
struct Foo {
    field: msgs.Location;
}

Import specific module objects:

import moduleName (objectName1, objectName2, ...)

Example: Instead of using an alias, you can import the objects by name like this:

import JM::NewPkg.msgs (Location)

// the struct from msgs named 'Location' can be accessed directly:
struct Foo {
    field: Location;
}

Creating Releases

Package releases can be created at any time by clicking the Releases button above the package and then Create Release. You'll be shown the difference in messages between the previous and the new release.

Exploring Messages

A list of the messages and transforms defined in a package can be viewed by opening it and clicking the Explore button above the package. Clicking on a message will go to it in the editor.