You can create Custom rules that extend the set of available standard Axeda® Platform rules, to execute actions based on events and conditions specific to your Platform and assets. For example, you can create a rule that archives Platform records after a number of days.
To configure a Custom rule in the Configuration application, you first need to create either a custom object or the Java class for that rule. If you have the appropriate license, you can create a custom object using the Custom Object wizard of the Configuration application. If you have a license for the Axeda® Connected Product Management Applications SDK, you can create the Java class using the SDK. When creating the Java class, the Custom rule class must implement the interface defined in the Axeda® Enterprise Server RuleContext class (in Rule interface, com.axeda.drm.sdk.rules). For more information, contact customer support at Axeda Corporation.
Notes: If you are migrating
to a shared environment (that is, the Axeda hosted environment), any existing
custom rule can be cut and pasted into a custom object (with the interface
declarations removed). Since the scripting language is a super-set of
Java, all existing Java code will work as is. The custom rules would then
need to be re-configured manually through the New Rule pages.
When creating a custom rule using the Axeda® Connected Product Management Applications
SDK, programmers at your site need to implement the rule interface for
the rule type. The rule interfaces are included in com.axeda.drm.sdk.rules.
Once the custom rules have been created, you need to add them to the special
configuration file, custom-rules.xml. From this file, the Platform generates
the list of custom rules. Programmers should refer to the Axeda® Connected Product Management Applications
SDK documentation for more information.
Use the tools on this page to create or modify a Custom rule for the selected assets, asset groups, and models.
1. From the Message Type list, select the type of message for this rule: alarm, event, data expression, or register.
2. From the Rule list, select the name of the custom object or Java Class for the rule. This name is required.
Notes:
This list of Rules contains the names of the custom
objects configured in the Platform as well as any custom rules implemented
at your site and specified in a special configuration file for your Platform.
If you have implemented custom objects, the names of those objects that
are of a rule type are included in this list.
If you are editing an existing custom rule, created with an earlier version
of the Platform, then you will see the Method and Parameters fields, in
which you can edit this information. Type the name of the method in the
associated Java class that contains the information for the rule. Then,
type the parameters to pass for the method, separating them with a comma.
3. If
this rule's actions should be executed every time the rule evaluates to
true, then select Consecutive.
If Consecutive
is not selected, the actions are executed upon the first evaluation to
true and are not executed again until the rule evaluates to false and
then to true again.
4. When
you are finished, click Next to
configure the parameters
for this custom rule,
if necessary. If the page for configuring parameters does not appear,
most likely the rule does not have any parameters for you to configure.
If the Custom rule instructions
page. appears, you are editing an existing custom rule that was created
with an earlier version of the Platform.
If the rule does not have any parameters, the Actions
for rule page appears.
If you click Cancel and continue
canceling, all information configured in this wizard is removed and a
list of rules appears.