Code

Action chart element.

Code block allows inserting a code snippet performing some action into your action chart. Code can be either a simple Java statement, or a set of statements, each one terminated by a semicolon. This code will be executed when the action chart control will reach the "code" block.

 To insert a "code" block into an action chart
  1. Drag the Code element from the  Actionchart palette onto the diagram of agent. While moving the mouse over the graphical editor you will see insertion points of action chart(s) indicated with little blue circles. Release the mouse button over the insertion point where you want to place the block. New "code" block will be inserted into this place.
  1. Go to the Properties view.
  2. In the Code field, type Java code you want to be executed when the control of the action chart will reach this block. This code will be shown inside the block on the diagram.

Properties

General

Code – The code that will be executed when the control of the action chart will reach this block. This code will be shown inside the block on the diagram.

Advanced

Name – The name of the element.

Label – You can add here some comments, explaining the meaning of this code snippet. The comments will be shown inside the block instead of the code.

Fill color – Sets the fill color for the element. Click inside the control and choose a color from the set of most used ones, or choose some custom color using the Colors dialog box.


Related topics

 Action charts. Defining algorithms visually

 Editing action chart blocks

 Creating an action chart. Tutorial