In this section: |
Environmental functions return information about or from the environment in which the document is being processed.
The _sreg() function uses the following format:
_sreg(name [,default])
name | string | Name of the register |
default | string | Default value |
Special registers contain context information. The information can be configured on the runtime system, reflect the processing state of the current message, or be explicitly set by services in a process flow.
Special registers exist in scopes, and are looked up from the local scope to the outermost scope (the system context); the value returned is that of the nearest scope in which the register is found. If the register is not found in any scope, the default is returned. If the default is not specified, null is returned.
The _sreg() function searches in a case sensitive manner. Consider the following examples:
Register Name | Value | _sreg('a','def1') |
a | hello | hello |
A | hello | defl |
The _property() function loads the value for the desired property from a Java properties object file. It uses the following format:
_property(file, attribute [, default [,control]] )
file | file name | Path to the properties file |
attribute | string | Name of the desired property |
default | string | Default if property does not exist |
control | string | Keyword to control operation:
|
Load the value for the desired property from a Java properties object file. The check option causes the properties file modification timestamp to be examined on each request to determine whether the file has changed since the last load, and if so the properties file is reloaded. The keep control option prevents this check for cases in which it is known that changes will not be made or should not be loaded. Avoiding the check can result in file read time savings. The keep option is the default.
For example, assume file test.properties contains:
one=first two=second
The following function call causes the value first to be returned:
_property('test','one','notfound','check')
Next, change the properties file to the following:
one=next two=second
In this case the following function call returns next:
_property('test','one','notfound','check')
If the control option is omitted or keep is used, the following function call returns first as before:
_property('test','one','notfound',keep')
iWay Software |