Apama Analytics Builder for Cumulocity IoT 10.3.1 | Apama Analytics Builder for Cumulocity IoT Documentation | Using Apama Analytics Builder for Cumulocity IoT | Wires and Blocks | Type conversions
 
Type conversions
It is legal to connect a block output to a block input if they are the same type. Most other connections are also permissible, which result in the conversions as described in the table below. An indicates that a connection is not legal; trying to deploy a model with such a wiring connection will fail.
From block with output type
pulse
boolean
float
string
any
Connect to input of type
pulse
pulse occurs when output changes to true
pulse occurs when output changes value
pulse occurs when output changes value
pulse occurs when output changes value (excluding changes to false)
boolean
true when the pulse has occurred, otherwise false
true if non-zero
true if not an empty string
true if value non-zero/empty
float
0 for false, 1 for true
string
"true" or "false"
number converted to a string (may be in scientific notation)
string value (may be in scientific notation)
any
Only conversions that will always succeed are allowed. String values are not converted to float values; while the input conversion may work sometimes, it cannot be guaranteed to always work.
In many cases, you need not worry about type conversions and where a wire makes sense. Any type conversion that is needed happens automatically.
Some blocks accept different types of inputs, and may change their output type or behavior depending on the input types. For example, the logical OR block can operate on either Boolean or pulse inputs, and its output is the same as its input types.
In some cases, it is desirable to force a value to be interpreted as a specific type, in which case a converter block can be used to force a conversion to a specific type. For example, the Pulse block can convert Boolean or float values to pulses, according to the conversions above. This means: for Boolean, generate a pulse when the Boolean value changes to true; for float, generate a pulse when the value changes. Thus, connecting two float outputs to an OR block directly will generate a Boolean output which is true when either of the float outputs is non-zero. Alternatively, connecting two float outputs each to a Pulse block and from them to the inputs of an OR block, will send a pulse whenever either float output changes value.

Copyright © 2018-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.