The classes needed for defining the variables and
expression script are present in the Expression Engine class folder. It
also contains the classes used to link the variables to the source
properties.
The Expression Engine includes these classes:
Variable Class:
The Variable class is used to define the variables that
map the source properties used in the Expression script.
This table describes the properties associated with the
Variable class:
Property Name |
Description |
Variable Name |
Name of the variable. Ensure that variable names do
not have spaces. |
Source Property |
Property name that is mapped to the variable name. |
Source Expression |
Sub-expression whose result is used as the value by
the variable. |
Replace Null With |
Value that is used for the variable if the source
property contains a NULL value. |
Is Pre-Edit Value |
If this property is set to true, this variable will
be assigned the original value (pre-edited value) of the edited
item. |
Note: For each variable, specify either the Source
Property or Source Expression.
-
The value for Replace Null With property should
match the data type of the source property.
-
If the data type of the Source Property is boolean,
then specify either, 1 or YES for true, 0 or NO for false in Replace
Null With property.
-
Variables declared in an expression cannot derive
value from within the same expression. For example A=B+C and B=A+E
are not allowed.
The default system-defined variables are set when
executing the expressions, by the Expression Engine.
This table describes the default system-defined
variables:
Variable |
Description |
retValue
|
Returns a value for an expression |
sysDate
|
System date |
sysDate_str
|
System date as a string |
sysClass
|
Class Label |
sysObjId
|
ID of the record that is inserted into the database |
sysEdit
|
Type of Edit operation (Insert, Modify, Delete,
NoOperation) |
sysMode
|
Type of Activity (Interactive or Non-Interactive) |
The Date variable (the variable that derives value from
a Date property) can be used for date-related operations.
If varDate is a date variable, then:
-
varDate+nD) adds n days to the date.
-
varDate+nM) adds n months to the date.
-
varDate_str denotes the variable varDate as
a string.
Note: Ensure that the date related operations in the
JPython script are enclosed within parentheses with no white spaces in
between.
Expression Class
The Expression class is used to write the Expression
script that evaluates the values of the variables and returns the value
to the target property.
This table describes the properties associated with the
Expression class:
Property Name |
Description |
Expression Name |
The name of the expression. |
Description |
A short description of the attributes and function
of the expression. |
Expression |
The JPython script that evaluates the expression
logic. |
Expression Language |
The scripting language used to write the expression.
Default expression language is Python. |
Expression Type |
Type of expression. Select Regular, Sub, Copy, or
Change Event from the Valid - Expression Type window. |
Associated Class |
The class to which the expression is attached. |
Target Property |
The property that receives the computed result of the
expression. This property belongs to the class specified in the
Associated Class box or the parent class of the class you specified
in the Associated Class box. |
Evaluation Mode |
Specifies whether the expression is in the online,
offline, or Timer Only mode. |
Return Variable Name |
Name of the variable used in the JPython script to
return a value. Default value for this is retValue.
Ensure that this property is assigned the default variable name
retValue. |
Is Active |
The value that specifies whether the expression is
active or disabled for execution. When Is Active is set to YES,
the expression is executed whenever a record is inserted or updated
in the class to which the expression is attached. When Is Active is
set to NO the expression is not triggered. |
Is Item Level |
If this property is set to YES, the Expression
Engine will look into the Expression Item class and execute the
expression only if the edited item is registered in this class. |
Pub Driver |
Specifies the publishing driver class name for change
event expressions. |
Note: The Target Property must be defined for a Regular
Expression. Ensure that you do not set the Target Property for the
sub-expression, copy expression or change event expression.
Expression Variable Path Class
The Expression Variable Path class is used to map the
variables to the expression. For a record in the Associated class, the
variable path is used to find the values for the variables, which are
used in the evaluation of the expression.
The Expression Variable Path class uses incoming and/or outgoing
pointers to locate the properties of the pointed class, whose values are
used in the expression.
This table describes the properties associated with the
Expression Variable path class:
Property Name |
Description |
Expression |
The pointer to the expression. |
Variable |
The pointer to the variable in the expression. |
Pointer |
The pointed property. |
Pointer Type |
The type of pointer. Select Incoming or Outgoing
from the Values - Pointer Type dialog box. |
Next |
The pointer to the variable path. |
Is Head |
Set to true only in the record which specifies the
starting point in the navigation, to fetch the property from an
associated class. |
Multi Value Parser Script Class
The Multi Value Parser script class is used to derive
one value from a list of values. When a variable is defined for an
incoming pointer property containing multiple values, you need to write
a Multi Value Parser script for that variable. This Multi Value Parser
Script calculates, for example, the average or the total of the list of
values and returns it to the expressions property associated with the
Multi Value Parser Script class.
This table describes the properties associated with the
Multi Value Parser Script class:
Property Name |
Description |
Expression |
The pointer to the associated expression. |
Variable |
The pointer to the associated variable. |
Parser Script |
The JPython script that evaluates a list of values. |
Argument Variable Name |
The name of the argument variable in the expression
script. By default it is argValue.
Note: Ensure that this property is assigned the default variable
name argValue. |
Return Variable Name |
The name of the variable that returns a value to the
expression script. By default it is retValue.
Note: Ensure that this property is assigned the default variable
name retValue. |
Refresh Class
The Refresh class is inserted with the object ID of the
item that is edited, if the class that the item belongs to has an
expression in the offline mode. The expressions are then executed at a
later time.
This table describes the properties associated with the
Refresh class:
Property Name |
Description |
Expression Class |
The pointer to the Expression class. |
Expression |
The pointer to the Expression. |
Affected Object |
The object ID of the record that is edited in the
Associated class when the expression is executed in the offline
mode. |
Expression Item Class
The Expression Item class acts as a mapping class
between an Expression and an CES Item. This class is used to define item
level expressions.
This table describes the properties of the Expression
Item class:
Property Name |
Description |
Expression Name |
The pointer to the Expression class. |
Explore Item |
The pointer to the Explore root class. |
Property Mapping Class
The Property Mapping class is used to specify the
mapping between the source and target related properties of the class
property associated with the Property Mapping class.
This table describes the properties associated with the
Property Mapping Class:
Property Name |
Description |
Copy Expression |
The pointer to the Copy Expression class. |
Source Property |
The property of the Source class. |
Target Property |
The property of the Target class in which the value
is inserted, updated or deleted. |
Use for Search |
The value that specifies whether the property should
be used as the search criteria in the Target class. |
Pointer Mapping Class
The Pointer Mapping class is used to specify the mapping
between source and target pointers of a related class property
associated with the Pointer Mapping class.
This table describes the properties associated with the
Pointer Mapping Class:
Property Name |
Description |
Copy Expression |
The pointer to the Copy Expression class. |
Source Pointer |
The pointer of the Source class. |
Target Pointer |
The pointer of the Target class in which the value
is inserted, updated or deleted. |
Use In Search |
The value that specifies whether the pointer should
be used as the search criteria in the Target class. |
Property Setting Class
The Property Setting class is used to edit a record and
insert a value in the target class property associated with the Property
Setting class.
This table describes the properties associated with
Property Setting Class:
Property Name |
Description |
Copy Expression |
The pointer to the Copy Expression class. |
Target Property |
The property in the Target class. |
Property Value |
The value to be inserted or updated in the Target
property. |
Use In Search |
The value that specifies whether the property should
be used as the search criteria in the Target class. |
|