Creating a new synthetic module

Starting in AX-3.7, the synthetic types framework feature enables non-developers to easily create and customize synthetic modules and types. A new (empty) synthetic module must be customized to make it usable. Of course, any changes you make must be saved and a restart is required.

The following procedures are described in this section:

To create a new synthetic (.sjar) module

You can create your own custom synthetic modules without having to write Java source code and compile it. The synthetic module is immediately available for customization without restarting Workbench or the station. Use the Synthetic Module File View to customize the module and save your changes. Resource files (images, px files and other sorts of data) may be included in the module. After customizing the module a restart is required.

NoteSynthetic modules can be created and edited from anywhere in the file system, however they must reside in the modules folder of the Niagara installation to be used by the station or Workbench. Also, Workbench uses the synthetic module icon () to distinguish synthetic modules from non-synthetic ones.

To create a new synthetic module using Workbench, follow these steps:

  1. In the nav side bar, expand My File System Sys Home nodes.

  2. Right-click on the modules node in the tree and select New->Synthetic Module.sjar from the popup menu to create a synthetic module, as shown in Figure 6. Give the module a name, such as “MySyntheticModule” and click Ok.

    NoteThe new synthetic module option is NOT found under theWorkbench Tools menu. This option, new in AX-3.7, displays in the dropdown menu when you right-click in the SysHome node.

    Figure 6. New synthetic module


    New synthetic module

    After creating a new (empty) synthetic module, you must launch the Synthetic Module File View to customize the new module and make it usable. The next procedure provides an example.

To register a synthetic type as an agent on another type

This procedure describes how to modify a synthetic module, create a new type and register this type as a agent on all components of a particular Niagara type.

For example, if you add a Tstat component (kitControl palette in the /hvac subfolder) to a station and create a new PxView assigned to that Tstat component. Making sure to “relativize” the ords so that there are no references to parent components in the slot paths, will set the stage to assign this PxView to any Tstat component in any station. Using standard methods you can build the PxView with some of the properties from that component. Next you can create a synthetic module with the intention of assigning the PxView as an agent on all Tstat components. To accomplish, this follow the steps below.

This procedure assumes you have already done the following:

  • Created a new (empty) synthetic module, such as the one created in the previous procedure.

  • Added a Tstat component (from kitControl /hvac subfolder) to a station, created a PxView (similar to the one shown in Figure 7) assigned to that Tstat component, and relativized the bound ords, as shown in Fig7.

    Figure 7. Station with new PxView assigned to Tstat component


    Station with new PxView assigned to Tstat component


  1. Expand My File System Sys Homemodules folder to locate the new synthetic module created earlier and double-click to open it. The module opens in the Synthetic Module File View (editor). For more details on using the synthetic module editor, refer to the section, About the Synthetic Module File View

  2. On the Files tab, add a new folder named “px”, then select the px folder and add the Px file created earlier. Including your Px file in the module guarantees file resources are available for the module to function properly when copied to another station.

  3. On the Types tab, add a new type named TstatGraphic, and on the type Details tab, select Super Type, baja:PxView from the drop down menu, as shown in Figure 8

    Figure 8. Add new Type with Super Type, baja:PxView


    Add new Type with Super Type, baja:PxView


  4. On the Slots tab, add a new slot named “pxFile” and select Type, baja:Ord, and configure the default value to reference the TstatGraphic.px file (added to the synthetic module in step 2), and click OK. The slots tab will display the entry, as shown in Figure 9.

    NoteThe slot name must be pxFile because we are overriding the pxFile property from BPxView.

    Figure 9. On Slots tab, add a slot for the Px file


    On Slots tab, add a slot for the Px file


  5. On the Agents On tab, click the Add button and in the dialog box, select kitControl:Tstat from the dropdown menu, and click OK, as shown in Figure 10.

    Figure 10. Add agent on module


    Add agent on module


  6. On the Files tab, click the Save button to save the synthetic module.

  7. Restart Workbench and either restart your local station or install the synthetic module to the remote JACE station that you are using.

    The end result of registering this synthetic type as an agent on the Niagara type, kitControl:Tstat, is that any Tstat component from kitControl will now have the PxView assigned as the default view.