The Procedures Palette
The Palette
Palettes are repositories of basic resources which become, in this case, the
building blocks and manipulators of the Procedure being created. Procedures
are used in six different applications:
- Transactions, Subledgers, and Global Procedures are related
to a given Template and, therefore, include a listing of all fields of their
Host Template as part of the Local area of Main Resources;
- User Functions, Report, and Process Procedures utilize
the same format as Transactions, Subledger, and Global; however, they do
not contain any Field-based resources (under the Local area of Main Resources)
since they are not related to any specific Template.
All Procedure Palettes have at least three basic views (Print templates are
applicable to the Report Procedure only):
Main resources
Local
Database Source
Database Fields
Operators and dividers
Draggable objects (Trigger conditions)
Draggable objects (functionality explained)
Functions
Accounts
Lists
Groups
Print templates (applicable to the Report Procedure only)
Procedures Palette - Main Resources
Main resources has three groups of resources (the image shown is that
of the Common Template Procedure Palette, hence the Fields shown
under Resources - Local are the fields as they occur in the Common
Template;
it also has Display only fields) :
- Resources
- Local
- Database - Source and Fields
- Operators and Dividers
- Draggabble objects
- Resources - Local
These are the resources that deal specifically with the Procedures' Host Template,
if applicable (n/a with User Functions, Reports, and Processes) as well
as system resources. These resources consist of:
Unique to Template-based Procedures
- Fields (the fields used in the Procedure's Host Template)
- Display only (View fields)
- System
- NEW_RECORD
for use in both Subledgers and Global Procedures
i.e. is the record I'm working on a new record?
- CNTRL_GL_PREFIX and CNTRL_GL_NUMBER
for use in Subledgers Procedures only
e.g. is the CNTRL_GL_PREFIX == EMPTY
- Arrays
- Special
for use in Check
Writing Transaction Procedures
- CHECK_#
optional, to override the default
- PAY_TO
optional, to override the default
- ORIGINAL_AMOUNT
- PAYMENT_AMOUNT
Unique to User Functions, Report and Process Procedures
- Parameters
Create as many as you need. This is a device which enables the introduction
of data from the "outside world" into the procedure or, conversely, from
the procedure to the "outside world." This data can be provided at
run-time or obtained from the database. To create a new parameter, select
the Parameter object and click New parameter or drag it into the target
object, at which point it is registered as par1, par2, etc. under
the heading Parameters. To properly name the generic id, double-click
the generic id in the Local resources (this will make it editable) and
type a meaningful name. Parameter id's may consist of multiple words separated
with a space. Click here for
additional detail.
Common to all Procedures
- Constants: The Logical Yes (switch is On) and No (switch
is Off), and the condition of the field or variable: Empty.
- Variables (user-definable)
Create as many as you need. To create a new variable, select
the target object in the Workspace and click New variable or drag
it into the target object, at which point it is registered as var1, var2,
etc. under the heading Variables. To properly name the generic id, double-click
the generic id in the Local resources (this will make it editable) and
type a meaningful name. Variable id's may consist of multiple words.
Initially the contents of the new Variable is EMPTY. It can be set
by explicitly assigning a value to the Variable in the Calculation object,
through the Function object, or Array Out object. Unlike the Parameter,
whose data type is explicitly set in the Parameters object, the Variable's data
type is inferred from the context of the Procedure in which it is used. Selection
of the data type in this case is done according to the following rules:
- if the Variable is assigned a value from the database field,
it inherits this field's data type;
- if the Variable is assigned a value from the Function object,
its data type is determined by the Function's return value type,
or by the Function's Parameter, if the Variable is placed
into the Parameter slot;
- if the Variable is assigned a value from the Array Out object,
its data type is set to the data type of the Variable in the same
position (slot) in the corresponding Array In object;
- if the Variable is assigned a value from the constant, it inherits
the constant's data type. For example:
|
| count = 0
| count is INTEGER
|
|
| weight = 1.5
| weight is FLOAT
|
|
| name = 'Unknown'
| name is TEXT
|
|
| paid = NO
| paid is LOGICAL
|
If there are several assignments of value to the same Variable that set it
to different data types, then the result may be either a syntactical error,
or one of the data types taking over. For example, assigning a FLOAT value
to a Variable of INTEGER type will make (promote it to) a FLOAT type, while
the assignment of TEXT type, in similar circumstances, is treated as an error.
- Resources - Database
This portion of the Main resources view has two columns: Source and Field.
Source shows all available database tables and clicking on any database table
name shown will display in the Field column all fields
contained in the database table selected.
- SOURCE
shows all database tables: Transaction and System tables;
and user-defined Global and Subledger tables (listed in alphabetical
order). To load a database table name (e.g. into a selected Retrieval object)
click the database name or drag it into the object.
- FIELDS
shows all the user-defined fields of the selected table listed under
Source; plus the System and Special Condition fields:
To load a database field into an object in the Workspace (e.g. Retrieval,
Calculation, etc.), select the object, then click on the field name.
- Resources - Operators and Dividers
Operators and dividers are used in Calculations and Conditional statements.
To load one of these into the selected object in the Workspace, click on the
desired symbol or drag it. They consist of:
| + |
Plus |
| - |
Minus |
| X |
Multiply |
| / |
Divide |
| = |
Assign value of |
| > |
Greater than |
| >= |
Greater or equal |
| < |
Less than |
| <= |
Less or equal |
| == |
Equal |
| != |
Not equal |
| AND |
Logical AND |
| OR |
Logical OR |
| [ |
Start of field |
| ] |
End of field |
| ( |
Start of group |
| ) |
End of group |
| ; |
End of statement |
Resources - Draggable objects
Draggabble objects are the executable building blocks of the procedural flowcharts.
To drag an object from
the Palette to the Workspace, grab the icon with the mouse, and start dragging.
The functionality and the
usage is explained under Working
with Draggable Objects.
- Procedures Palette - Functions
The Functions view is displayed automatically when a Function draggable
object is landed into the Procedure Workspace. The view has two columns: Name and Description (displayed
when a Function is selected in the Name column). The Name column lists
the available Functions within three possible groups: User-defined, System,
and Reports.
- User-defined
all Functions created under Architecture > User Functions
- System
a large variety of useful functions e.g. AddToDate:
AddToDate function increments or decrements the date by the given number;
the number is treated as days, weeks, months or years according to the setting
of the Units parameter. The Function takes the following input parameters:
|
| <Date>
| original date,
|
|
| <Increment>
| number of date units to be added (if positive) to or subtracted (if negative) from the original date,
|
|
| <Units>
| date units.
|
Once a Function object is brought into the Workspace and the function name
(e.g. AddToDate) is selected (click or drag-and-drop), the object expands to
receive the parameters:
- Reports
all user-defined reports (Report Builder > Report Procedures).
Procedures Palette - Account lists
Account lists can be utilized when defining the Search Criteria for
database related activities e.g. retrieval; or in Function objects. The view has two columns:
- Name (of defined Account lists)
- Description (of accounts or account ranges making up the selected Account
list)
Procedures Palette
- Account groups
Account groups can be utilized when defining the Search Criteria for database related activities e.g. retrieval; or in Function objects.
The view has two
columns:
- Name (of defined Account group)
- Description (of Account list(s) making up the selected Account
group)
Procedures Palette - Print templates
The Print templates view will be displayed when a Print object
is loaded into the Procedure's Workspace or when specifically selecting Print
templates Palette tab.
When the Print Template Name has been loaded into the Print object
in the Workspace, the Inspector will display the Print template
variables, if any, and show placeholders for the flowchart variables that
carry data to be printed by the template.