Custom Object wizard - Create or Edit Custom Object

Use the pages in the Custom Object wizard to create custom objects or edit existing ones. This wizard prompts you for the information required to create a custom object. For existing custom objects, the wizard shows the existing information for that custom object and permits you to make changes in all fields except the Type of custom object.

Notes: Currently, the supported version of Groovy is 1.8.2.

For information on the global variables available to expression rules and custom objects, refer to the topic, Global Variables for Custom Objects.

The wizard information for a custom object is presented as follows:

o        Create custom object / Edit custom object page - specify a name, a type, a description, and the source code. As needed, configure parameters for the object.
Compile the custom object before clicking Next; otherwise, when you click Next or Finish, the Platform compiles it for you. The Compilation Results appear in a separate window.

o        Custom Object Test page - after you compile the custom object successfully, click Next, and select parameters for testing the custom object and run the test. The results appear in a separate window, Test Results.

o        Commit Custom Object page - review the information displayed for the custom object. To make changes, click Back. To commit the custom object to the Platform, click Finish.

Warning! When moving backward and forward through the wizard, use the wizard's Back and Next buttons. Do NOT use your browser's tools back and forward tools. You will lose data if you use the browser tools.

To add or edit a custom object

Important! Before creating custom objects, be sure to review the recommendations in Axeda Rules Development Guidelines (PDF), which provides best practices to follow when creating custom objects.

Even if a custom object is currently used in a rule or action, you can edit it. The text fields accept varying numbers of characters, but they all accept spaces and special characters such as , ; ! @ # $ % & * ( ) + / \ and so forth. As long as you recompile and test your changes, the rule or action will run the next time it is invoked.

 

1.       In the Name field, type a unique identifier for the custom object. This field is required. The name can be up to 70 characters in length. The custom object appears by this name in the View and manage custom objects page. You can change the name of an existing custom object.

Note: If you are using this custom object in an Extended UI Module, do not include escape characters in the custom object Name. The use of escape characters (for example, slashes " / " and backslashes " \ ") in custom object names is not supported for Extended UI Modules.

2.       For a new custom object only, select the Type of custom object from the list: Alarm Rule, Data Rule, Event, Extended UI Module, Registration Rule, Action, IDM Agent WS Extension, or Shoulder Tap. Once the custom object has been added to the Platform, you cannot edit the Type.

Notes: The Axeda Platform SDK always uses the term "device" instead of "asset." In the context of custom objects, these two terms are synonymous. While "asset" is used in the user interface text, "device" is used in code.

The Shoulder Tap type of custom object is for Groovy scripts that you want to use as the Transport for the Shoulder Tap delivery method. For more information, refer to Appendix A of the Axeda Platform Web Services Developer's Reference. For an example of this type of custom object, refer to Custom Object Example: Transport for the Shoulder Tap Delivery Method.

The Extended UI Module type of custom object is for rendering custom objects in Extended UI Modules. This is available based on Platform license.

3.       Optionally, type a Description of the custom object. For example, explain what the code does. You can use up to 2000 characters.

4.       In the Source Code text box, enter your source code. This field is required; there is no limit on the number of characters in this field. Your custom object can return binary or non-binary data, and can accept binary uploads (such as file uploads). Most examples in the help return non-binary data. For a snippet example that returns binary data, see Return binary data from Custom Objects.

Important: If you want to show a custom object in an Extended UI Module, the object MUST return actual, viewable content. If the custom object is not defined to render displayable data, the Extended UI Module will NOT be shown in the related Asset dashboards.

Custom object access to Axeda and other, third party web services and API is restricted to ensure that scripts cannot harm Platform processing and data. See the security policy for the Platform.

See examples to get started....

For example code, refer to Examples of Custom Objects. For an example of using IDM Web Service Extensions, refer to Example Custom Object of Type IDM Agent WS Extension. For an example of  creating a Communication Mode property for Axeda IDM Agents, refer to Custom Object Example: Creating a Communication Mode Property for Axeda IDM Agents.

For an example of creating a custom object to be shown in an Extended UI Module, see examples of custom objects.  

For assistance with the attributes for each type of custom object, follow these links: Alarm Object Attributes, Data Item Object Attributes, Device Object Attributes, Event Object Attributes, Logger Object.
To create a custom object script to use the "DataValue" interface or to change a custom object script that currently uses the interfaces "XmlInfoDataValue" or "EDataDataValue so that it uses "DataValue" instead, click the following text once to display sample scripts; to hide the examples, click the text again:

How to use the interface "DataValue", especially if you previously used "XmlInofoDataValue" or "EDataDataValue"

5.       Click Compile to compile your source code. The Compilation Results window displays the results.

6.       As needed, click Configure parameters to create or modify the parameters for the custom object. When creating a new rule or action using this custom object, the user will be prompted to enter a value for each parameter you create (or modify) here.

7.       Click Next to test your custom object.

At any time, you can discard your changes and return to the View and manage custom objects page by clicking Cancel.

Next Steps?

Now you can configure your custom object to be executed in runtime, from expression rules or from Axeda Web services. Also if supported by your Platform, custom objects of type "Extended UI Module" can be configured to run in Extended UI Modules.

Important! A new custom object must be committed to the Platform (click Finish in the Commit Custom Object page) before it can be configured for runtime execution . In addition, any changes you make to an existing custom object (including source code) are not available until you commit them to the Platform.