Write expressions in plain English and in validation expression syntax
Written in plain English, here are some examples of expressions or rules you might like to enforce in Aspen:
- Active special education students must have a valid Educational Environment code.
- Students whose names start with A - L must have Mr. Smith as their guidance counselor, except students in homeroom 125.
- Special education students cannot receive out-of-school suspension.
Use validation expression syntax to write rules
First, you need to understand the structure of an expression written in syntax.
Structure of an Expression
Three Components of an Expression
Value Tokens
Symbol |
Description |
Example |
---|---|---|
a
|
Alias |
{a:DOE Department of Education 12} {a:relStdPsnOid.DOE 09} |
f
|
Field ID |
{f:stdEnrStatus} {f:relStdPsnOid.psnGenderCode} |
b |
Bean path |
{b: {b:person.genderCode} |
as |
State code by alias |
{as:DOE 12} {as:relStdPsnOid.DOE 09} |
fs |
State code by ID |
{fs:stdEnrStatus} {fs:relStdPsnOid.psnGenderCode} |
bs |
State code by bean path |
{bs: {bs:person.genderCode} |
[blank] |
Literal |
{Hello} |
Comparison Operators: Use comparison operators to compare two value tokens.
Symbol |
Description |
Example |
---|---|---|
= |
Equals |
{a:DOE 12} = {Active} |
!= |
Does not equal |
{a:DOE 12} != {Active} |
>= |
Greater than or equal to |
{b:yog} > = {2021} |
<= |
Less than or equal to |
{b:yog} <= {2023} |
> |
Greater than |
{f:relStdPsnOid.psnDob} > {1997-08-31} |
< |
Less than |
{f:relStdPsnOid.psnDob} < {2010-01-01} |
$ |
Contains |
{f:stdViewAdrs} $ {Main St} |
!$ |
Does not contain |
{f:stdViewAdrs} !$ {Main St} |
~ |
Matches (a regular expression) |
{b:homeroom} ~ {\d\d\d} |
!~ |
Does not match (a regular expression) |
{b:homeroom} !~ {\d\d\d} |
SW |
Starts with |
{f:stfBargainUnit} SW {Teacher} |
!SW |
Does not start with |
{f:stfBargainUnit} !SW {Teacher} |
EW |
Ends with |
{f:stfBargainUnit} EW {-PT} |
!EW |
Does not end with |
{f:stfBargainUnit} !EW {-PT} |
IN |
In (a comma delimited list) |
{fs:stdGradeLevel} IN {09, 10, 11, 12} |
!IN |
Not in (a comma delimited list) |
{fs:stdGradeLevel} !IN {09, 10, 11, 12} |
EMPTY |
Empty |
{a:DOE 01} EMPTY {} |
!EMPTY |
Not empty |
{a:DOE 01} !EMPTY {} |
Boolean Operators
Symbol |
Description |
Example |
---|---|---|
& |
And |
{a:DOE 12} = {Active} & {a:DOE 01} EMPTY {} |
| |
Or |
{a:DOE 12} = {Active} | {a:DOE 12} = {Graduated} |
Parentheses
Example |
---|
{a:DOE 12} = {Active} | ({b:yog} < {2020} & ({a:DOE 12} = {Graduated} | {a:DOE 12} = {Withdrawn})) |
Expression Examples