Use Alfabet parameters

Alfabet parameters refer to the current context in the Alfabet user interface, for example, the object the user is currently working with, the user executing the report, the current workflow being executed, or a filter the user has set.

During execution of the query, the Alfabet parameter is substituted with the current return value. If no value is returned, the Alfabet query is executed without the WHERE statement.

Alfabet parameters can be used in native SQL and Alfabet queries. In native SQL and in the the Alfabet query language, parameters are written as follows:

For example the Alfabet query:

  • FIND
  • ApplicationGroup
  • WHERE ApplicationGroup.BelongsTo CONTAINS @BASE

as well as the native SQL query:

  • SELECT appg.REFSTR, appg.NAME
  • FROM APPLICATIONGROUP appg
  • WHERE appg.BELONGSTO = @BASE

find all application groups subordinate to the application group the user is currently working with.

When defining the value for the condition in the Alfabet Query Builder, select the checkbox Parameter in the dialog box for the definition of the value for the WHERE condition. In the Name field, enter a technical name of the filter field or the name of the Alfabet parameter referring to the current environment.

11-10-AQL_ParameterInBuilder 

After clicking OK, you will see the Where clause in the Alfabet Query Builder with a colon written before the value. This is an alternative syntax for writing parameters that is only valid for Alfabet query language.

11-10-AQL_ParameterInWhere 

When defining a filter, the Alfabet parameter in the WHERE clause must be identical to the name of the filter field. When referring to the current environment, the parameter name after the @ sign can be any of the following:

Parameter Name Description
CURRENT_PROFILE Returns the value of the REFSTR property of the current user profile of the user.
CURRENT_USER Returns the value of the REFSTR property of the current user.
CURRENT_MANDATE Returns the current mandate of the user. The Alfabet parameter can be used for example to limit search results to objects that are assigned to the mandate the user is currently logged in with, for example:
  • ALFABET_QUERY_500
  • FIND ICTObject
  • WHERE ICTObject.MANDATEMASK CONTAINS :CURRENT_MANDATE

NOTE: The parameter CURRENT_MANDATE (and the whole statement it is used in) is ignored if the user has no mandate assigned or is working as mandate master.

CURRENT_CULTURE Returns the Microsoft® Windows® Locale identifier (LCID) of the current culture used to render the user interface.

Please note that the culture that is selected as default culture is always returned as 127, which means default, independent from the LCID of the culture.

CURRENT_THEME Returns the UI theme the user currently selected for display of the user interface. This is for future use in configured reports to substitute the concept of color rules with coloring responding to customer themes.
TODAY Returns the current date.
BASE Returns the value of the REFSTR property of the current object.
BASES Returns the REFSTR values of all objects currently listed in a data workbench or, if objects are selected, of all objects currently selected in a data workbench. It compares a single REFSTR to the list of REFSTR values. Therefore it cannot be used with reference array properties in WHERE statements of Alfabet query language. Usage is limited to data workbenches. The parameter can be used, for example, in configured reports added to a data workbench via a data workbench configured report group.
SELECTION Returns the REFSTR values of all objects currently selected in a data set. If no objects are selected, nothing is returned.
BASE<number> For queries defined in the context of layered diagrams and grid reports only! If the report is configured to allow cascading queries, and more than one level of related objects us defined, BASE0 returns the value of the REFSTR property of the parent object in the directly superordinate level of the diagram. BASE1 returns the ancestor object in the level superordinate to the parent object level etc.
WIZARDBASE For queries defined in the context of wizard configuration only! Return the value of the REFSTR property of the base object of the wizard. The base object of the wizard can be different from the base object of a wizard step. This parameter allows to refer to the base object of the wizard for example in pre-conditions of steps that have a different base object than the overall wizard.
WORKFLOW For queries defined in the context of workflow configuration only! Returns the value of the REFSTR property of the workflow. Each workflow corresponds to an object Workflow in the Alfabet database. The parameter is useful when defining queries that refer to properties of the class Workflow, like for example the workflow owner or the workflow initiator.
WORKFLOWBASE For queries defined in the context of workflow configuration only! Returns the value of the REFSTR property of the base object of the workflow. The base object of the workflow can be different from the base object of a workflow step. This parameter allows to refer to the base object of the workflow for example in pre-conditions of steps that have a different base object than the overall workflow.
LAST_EXECUTION For queries defined in the context of monitors only. Returns the date of the last execution of the monitor.
ALIASNAME Returns the name of the server alias used for the Alfabet database connection to execute the query.
ALIASCAPTION Returns the caption of the server alias used for the Alfabet database connection to execute the query.
ALFA_SERVER_URL Returns the value of the attribute Web Server of the server alias configuration of the Alfabet component processing the query. The attribute Web Server is editable in the Overview tab of the server alias configuration editor.

The Test Query  Expand_AQL_Test button of the Alfabet Query Builder cannot be used to test queries with Alfabet parameters. If you define a configured report, you can test the query using the Review Report option in the context menu of the report.