Expressions
An expression is a combination of variables, constants and operators
that on evaluation yields a single value.
Expression types
Expression in deluge are classified as follows:
String Expression
A string expression evaluates to a sequence of characters or text.
For example: "abcd" , "zoho " + "creator " + "
- online"
sendmail [ To : this.name+"@adventnet.com" Subject : "The feedback you had sent has been incorporated in zohocreator" Message : "Comments" + this.comments ]
|
In the above sample,
- comments and name are the fields of the form.
- name+"@adventnet.com" is a string expression.
- "Comments " + this.comments is also a string expression.
Numeric Expression
A numeric expression evaluates to number, either floating point (e.g.
4.556 or -5.311) or integer numbers (e.g. -41 , 6243).
English ( type = number decimalplace = 2 ) Arts ( type = number decimalplace = 2 ) AverageMarks ( type = formula value = (English + Arts) / 2 )
|
In the above sample, (English + Arts) / 2 is a numeric expression
DateTime Expression
A datetime expression involves operations with date, time, day, week
and such calenderial terms. A fixed number of days, week or time can
be added or subtracted from date. The final value of such expression
should be a valid date with time information.
filters ( "joined on 4th july" : (Date_Of_Joining == '04-Jul-2006') )
|
In the above sample, Date_Of_Joining is a date type field
Boolean Expression
The result of a boolean expression has only two states, true or false.
The boolean expressions are nothing but conditional expressions used
to evaluate or analyze certain condition and return true or false depending
on whether the condition checked succeeded or failed.
e.g. 2 > 4, 4< 6 && (5%6) > 3. Also any value that
is not nil or the constant false is true.
filters ( priority status "High Priority" : ((priority == "V.High" || priority == "High") && (status == "Open")) )
|
Variables
Refer the topic, Set Variable for
more information.
Literals or Constants
Literals indicate values written directly like "Hello world",
4. e.g "Hello world" is a string literal and 4 is a numeric
literal.
sendmail [ To : this.name+"@adventnet.com" Subject : "The feedback you had sent has been incorporated in zohocreator" Message : "Comments" + this.comments ]
|
In the above sample, "support@zohocreator.com" is a
string constant.