Pre-compilation of an application into an
.sbar allows for faster application startup. This comes at the cost of configuration flexibility unless you replace
operator-parameters with expressions using constants and use
constants-override configuration instead.
Configuration Steps:1. For each operator or adapter property, provide a
Constant with a default value.
In the EventFlow editor, Definitions tab, create a constant and supply a default value. For string values, surround the value with quotes. Numeric and boolean values do not use quotes. For example, define constant
CSVFILE with value
"lookup.csv".
2. In the StreamBase Properties view, for each property, supply the name of the constant as an expression, using an equals-sign, as so:
File Name:
=CSVFILEFor boolean and selection properties, use the
[T] control by the property name to change the field to a free-form expression box.
3. Compile the application (example):
sbargen -f sbd.sbconf test.sbapp test.sbar4. Supply replacement values in the server configuration file using constants-overwrite (example,
prod.sbconf):
<streambase-configuration>
<constants-overwrite>
<constant-overwrite name="VALIDATE" value="FALSE"/>
<constant-overwrite name="LIMIT" value="100"/>
<constant-overwrite name="CSVFILE" value="'C:/production/references/lookup.csv'"/>
<constant-overwrite name="RV_PORT" value="'tcp:8502'"/>
</constants-overwrite>
</streambase-configuration>
For string values, surround the value with single quotes.
5. Run the application with the replacement
.sbconf (example):
sbd -f prod.sbconf test.sbarThe properties will be set at startup with the new values supplied for each constant referenced in the application and configuration.