A new Rule can be created in the following ways:
Refer to Rule JSON Examples
• You can load a modifiable rule with the atm.load <path_to_json_file> -r command.
• You will have unmodifiable rule with loading a file via File Watcher service. Its json file is in the folder you have created in advance: ../<bosch.iot.sdk_home>/runtime/osgi/automation/rules. Changes you make to the file apply to the rule. Deleting the file removes the rule from the automation module. The /automation folder must be manually created and present before the automation.core bundle is started otherwise the service will not work.
Automation Rule State Transitions

FROM/TO |
UNRESOLVED |
RESOLVED |
ACTIVE |
DISABLED |
REMOVED |
|---|---|---|---|---|---|
UNRESOLVED |
|
|
N/A |
|
|
RESOLVED |
|
N/A |
|
|
|
ACTIVE |
|
Rule run finish |
N/A |
|
|
DISABLED |
|
N/A |
N/A |
|
|
REMOVED |
N/A |
N/A |
N/A |
N/A |
N/A |
Bindings between Rule Instructions
Instructions can consume/produce static or dynamic data by virtue of their inputs and outputs. For the needs of the dynamic data there are bindings defined, which follow certain rules as described below.

An input binding is defined by:
The source format depends on the binding type:
where using a reference allows accessing value of complex data type and its format could be an array or list index, e.g. [0] to refer the element at zero index id if the source value is of type array or list index
It is possible to chain these references in one bigger expression, e.g. [0]/id/name.
The source of the bindings from type Type.CONSTANT must follow the proper rules:
The bindings between inputs and outputs of instructions must follow the proper rules:
An exception to the above rules is made only in case a reference is defined.
The condition or action inputs can be connected to triggers' or preceding conditions' or actions' outputs.
Supported Container Conversion
From/To |
Array |
List |
Collection |
Set |
Map |
|---|---|---|---|---|---|
Array |
+ |
+ |
+ |
Exception |
Exception |
List |
+ |
+ |
+ |
Exception |
Exception |
Collection |
+ |
+ |
+ |
Exception |
Exception |
Set |
+ |
+ |
+ |
+ |
Exception |
Map |
Exception |
Exception |
Exception |
Exception |
+ |
Supported Type Conversion
From/ To |
boolean |
Boolean |
char |
Character |
String |
Primitive Numeric |
Java Core Numeric |
Custom Numeric Bean |
Other |
|---|---|---|---|---|---|---|---|---|---|
null |
False |
null |
Character.valueOf((char)0) |
null |
null |
default primitive:
|
null |
null |
null |
boolean/ Boolean |
+ |
+ |
Exception |
Exception |
+ |
Exception |
Exception |
Exception |
Exception |
char/ Character |
Exception |
Exception |
+ |
+ |
+ |
|
|
Exception |
Exception |
String |
"true" ? True : False |
"true" ? True : False |
|
|
+ |
|
|
Exception |
Exception |
Primitive/ Java Core Numeric |
Exception |
Exception |
+ |
+ |
+ |
+ |
+ |
Exception |
Exception |
Custom Numeric Bean |
Exception |
Exception |
Exception |
Exception |
+ |
+ |
+ |
Exception |
Exception |
Other |
Exception |
Exception |
Exception |
Exception |
+ |
Exception |
Exception |
Exception |
Exception |
Legend