WSO2 CEP SIDDHI LANGUAGE boolean type - stream

Is there an allowed boolean type to be used in siddhi query language when defining streams ?
By looking at the language model of Siddhi versiĆ³n 310 "https://docs.wso2.com/display/CEP310/Language+Model" it looks like there is no support for stream boolean attribute type. They only allow: int, long, double, float, string, time types.

It does support boolean, please use bool.

Related

Primitive Data Types in Dart Lnaguage

My question is short and simple.
when everything is in dart no matter it is a string, boolean, int, float, or char everything is stored in the object in dart language.
so according to the definition anything which has a reference type(Stored in object) is non-primitive, so is all the above types are non-primitive in the dart, or if these are primitive then what about the definition, anything stored in an object is non-primitive.
also, tell me what are the primitive data types of dart language
If you define "primitive value" to be a non-reference value, Dart doesn't have any.
All Dart values are (references to) object instances that implement either Object or Null. All can be stored in a variable of type Object?.
Some types are more closely supported by the runtime system (like int, double, String, bool and Null), and for performance and platform interoperability reasons, you are not allowed to have your own classes implementing those. In a sense, those are "fundamental" types (I wouldn't say "primitive", but others might).

Dart naming convention

Why in dart we have String not string
Other types are in lower case
int not Int
double not Double
The reason for the naming was to make Dart more familiar to people coming from Java (or C#, but mostly Java).
That's why int, double, bool and void are lower-case and String is capitalized, because that's what they were in Java (although boolean was considered too damn long).
The num type got looped in too, because it's so closely tied to int and double, and dynamic was lower case to mark it as a special type, like void.
(Special types added later, like FutureOr or Never, were not made lower case because that increased the risk of conflicting with existing variable names, something the original language didn't have to worry about.)
Dart does not have primitive types like, say, Java. All Dart values are objects, and you can call methods on them.
Primitive types are starting with lower case (int, double, char ...). String is not a primitive type its an object therefore it doesn't start with lower case

Why some Dart built-in types start with capital letter(List, Map, String) and others with lower letter(number, int, double, bool)?

Is it Java ancestry or is it collection related?
Is there a pattern and how dynamic type fits in it?
Dart chose the naming for its familiarity for people coming from Java. That's why int, double, void and bool are lower-case even though they are not "primitive" types in Dart (and even if bool was made shorter than the Java boolean type.)
The num class does not exist in Java, but it follows int and double types for consistency.
The dynamic type was probably just lower-cased for convenience, and because it was actually a non-class type.
Historically languages like Java and C# have categorized the types into 2 main categories:
primitive types (int, char, bool, long, double etc)
user-defined types (List, Map, Future, Animal, Car etc)
To set the difference clearly, the convention has been to follow CamelCase i.e. starting with a capitalized character for user-defined types and follow pascalCase for primitive ones
dart, like lot of other features takes this convention from these 2 languages.
NOTE: The String type has been a special case for a long time. C# has both a type named string and an alias type named String. Java however takes the C++ philosophy and doesn't consider String as a primitive type. Hence uses CamelCase. For String dart has followed the java path.
PS This GitHub Issue discusses about the String issue in detail.

What is the type for currency?

I can't find a sample of currency data type in the object definition, nor a document on the subject.
There is no built-in "currency" type. You would typically use type: number with an optional format modifier to indicate the meaning of the numeric type:
type: number
format: currency
format can have arbitrary values, so you can use format: currency or format: decimal or whatever your tool supports. Tools that recognize the given format will map the value to the corresponding type.
The type in the OpenAPI 2.0 standard closest to typical decimal dollar values seems to be type number, format float, which is a 32-bit floating point format (see other online discussions such as here)

How do I check if a Variant is a TDateTime?

I have an object, that has one value, but that value can either be an integer, string, boolean or TDateTime. So, it is a Variant.
I use VarType() to check its type, but since VarType() has no 'varDate' or 'varDateTime', I am using 'varDouble', because as far as I can gather, a TDateTime is a double.
But that returns false. I also cannot use is to check if the Variant is TDateTime. Is there a way, or should I make some sort of type variable that determines which type the value is and use that to check it?
Your assumptions are incorrect; there is in fact a varDate.

Resources