JGrafchart contains both graphical and textual language elements. The textual language is primarily used for expressing step actions and transition conditions. A step action consists of two parts: an action qualifier and the actual action. The action qualifier decides when to execute the action. Five qualifiers are available.
Enter action
(Stored action). The action is executed once when the step becomes active.
S "action";
Exit action
The action is executed once immediately before the step is deactivated.
X "action";
Periodic action.
The action is executed periodically, once every scan-cycle, while the step is active.
P "action";
Abort action
The action is executed once when a step is aborted due to the firing of an exception transition.
A "action";
Normal action
(Level action). A normal action is used to associate the truth-value of a boolean variable with the activation status of the step. When the step is activated or deactivated the variable is marked accordingly. At the end of the scan cycle, all marked variables are updated. A variable that is marked with both activate and deactivate is set to true.
N "boolean variable";
"action" can be either an assigment or a call.
Assignment
"variable" = "expression"
"variable" is the variable to assign to. How "expression" is evaluated is determined by the type of the variable. For example, if the variable is real the expression will be evaluated as a real-valued expression.
Call
["object expression".]"name"(arg1, ..., argn)
Methods for objects and built-in functions can be called. "object expression". is the object that a method is called on for method calls and is left out for function calls. "name" is the name of the called function/method.
The action language is also used to express transition conditions. A transition condition is represented by an expression, which is evaluated as a boolean expression.