2017 October Release

General remarks concerning app.ducx expression languagePermanent link for this heading

app.ducx Expression Language is a distinct domain-specific language of Fabasoft app.ducx. app.ducx expressions can be embedded inline in an expression block in other domain-specific languages. However, it is also possible to create separate .ducx-xp files containing app.ducx expressions. app.ducx expression language files can be referenced from other domain-specific languages using the file keyword.

The app.ducx expression language is processed by the Fabasoft app.ducx compiler and transformed into Fabasoft app.ducx Expressions, which are evaluated at runtime by the Fabasoft Folio Kernel.

Keywords, predefined functions and predefined variables are not case sensitive.

Evaluating expressions at runtimePermanent link for this heading

In the first step, the expression code is parsed. An expression can be parsed at runtime by calling the Parse method of the Fabasoft Folio Runtime. The Parse method returns an expression object (which is not related to an object stored in the Fabasoft Folio). In a second step, the Evaluate method is invoked on the expression object for evaluating the expression. The scopes to be used during the evaluation of the expression must be passed to the Evaluate method. The result of the evaluation is passed back in the return value of the Evaluate method.

Testing expressionsPermanent link for this heading

The Fabasoft app.ducx Expression Tester (see next figure), allows you to test your expressions on the fly.

Figure 21: Fabasoft app.ducx Expression Tester

With the Fabasoft app.ducx Expression Tester, you can also set the contents of local and global scope to simulate the actual situation in which your expression will be evaluated.

Tracing in app.ducx expression languagePermanent link for this heading

Using app.ducx expression language, you can write trace messages to the Fabasoft app.ducx Tracer, which can be found in the Setup\ComponentsBase\Trace folder on your product DVD.

For writing messages and variable values to the trace output, you can either use the %%TRACE directive or the Trace method of the Fabasoft Folio Runtime.

If you pass two arguments to the Trace method of the Fabasoft Folio Runtime, the first argument is interpreted as a message while the second argument is treated as the actual value.

The %%TRACE directive can also be used to trace special objects like cootx to output all transaction variables defined for a transaction or coometh to output all set parameters within the implementation of a method.

Note:

  • Values traced using the %%TRACE directive are only written to the Fabasoft app.ducx Tracer if trace mode is enabled for the corresponding software component whereas values traced using the Trace method of the Fabasoft Folio Runtime are always written to the Fabasoft app.ducx Tracer.
  • Keep in mind that the %%TRACE directive only works for method implementation and customization points.

For further information on enabling trace mode for a software component refer to chapter “Tracing in Fabasoft app.ducx projects”.

Example

// Tracing string messages
coort.Trace("This message is written to the trace output");

// Tracing variable values
string mystrvar = "Hello world!";
object myobjvar = cooroot;
coort.Trace("Value of mystrvar", mystrvar);
coort.Trace("Value of myobjvar", myobjvar);

// Trace directives are only evaluated if the software component
// is in trace mode

%%TRACE("Value of mystrvar", mystrvar);
%%TRACE("Value of myobjvar", myobjvar);

// Tracing local and global scope
coort.Trace("Local variables", this);
coort.Trace("Global variables",::this);