You can control a variety of flow properties with scripting. To reference flow properties, you must set the execution method to use scripts:
stream = modeler.script.stream()
stream.setPropertyValue("execute_method", "Script")
Example
The node property is used to refer to the nodes in the current flow. The following flow script provides an example:
stream = modeler.script.stream()
annotation = stream.getPropertyValue("annotation")
annotation = annotation + "\n\nThis flow is called \"" + stream.getLabel() + "\" and
contains the following nodes:\n"
for node in stream.iterator():
annotation = annotation + "\n" + node.getTypeName() + " node called \"" + node.getLabel()
+ "\""
stream.setPropertyValue("annotation", annotation)
The previous example uses the node property to create a list of all nodes in the flow and write that list in the flow annotations. The annotation produced looks like this:
This flow is called "druglearn" and contains the following nodes:
type node called "Define Types"
derive node called "Na_to_K"
variablefile node called "DRUG1n"
neuralnetwork node called "Drug"
c50 node called "Drug"
filter node called "Discard Fields"
Flow properties are described in the following table.
Property name | Data type | Property description |
---|---|---|
execute_method
|
Normal Script |
|
date_format
|
|
|
date_baseline
|
number | |
date_2digit_baseline
|
number | |
time_format
|
|
|
time_rollover
|
flag | |
import_datetime_as_string
|
flag | |
decimal_places
|
number | |
decimal_symbol
|
Default Period Comma |
|
angles_in_radians
|
flag | |
use_max_set_size
|
flag | |
max_set_size
|
number | |
ruleset_evaluation
|
Voting FirstHit |
|
refresh_source_nodes
|
flag | Use to refresh import nodes automatically upon flow execution. |
script
|
string | |
annotation
|
string | |
name
|
string | This property is read-only. If you want to change the name of a flow, you should save it with a different name. |
parameters
|
Use this property to update flow parameters from within a stand-alone script. | |
nodes
|
See detailed information that follows. | |
encoding
|
SystemDefault "UTF-8" |
|
stream_rewriting
|
boolean | |
stream_rewriting_maximise_sql
|
boolean | |
stream_rewriting_optimise_clem_ execution |
boolean | |
stream_rewriting_optimise_syntax_ execution |
boolean | |
enable_parallelism
|
boolean | |
sql_generation
|
boolean | |
database_caching
|
boolean | |
sql_logging
|
boolean | |
sql_generation_logging
|
boolean | |
sql_log_native
|
boolean | |
sql_log_prettyprint
|
boolean | |
record_count_suppress_input
|
boolean | |
record_count_feedback_interval
|
integer | |
use_stream_auto_create_node_ settings |
boolean | If true, then flow-specific settings are used, otherwise user preferences are used. |
create_model_applier_for_new_ models |
boolean | If true, when a model builder creates a new model, and it has no active update links, a new model applier is added. |
create_model_applier_update_links |
createEnabled createDisabled doNotCreate |
Defines the type of link created when a model applier node is added automatically. |
create_source_node_from_builders |
boolean | If true, when a source builder creates a new source output, and it has no active update links, a new import node is added. |
create_source_node_update_links |
createEnabled createDisabled doNotCreate |
Defines the type of link created when an import node is added automatically. |
has_coordinate_system |
boolean | If true, applies a coordinate system to the entire flow. |
coordinate_system |
string | The name of the selected projected coordinate system. |
deployment_area |
modelRefresh Scoring None |
Choose how you want to deploy the flow. If this value is set to
None , no other deployment entries are used. |
scoring_terminal_node_id |
string | Choose the scoring branch in the flow. It can be any terminal node in the flow. |
scoring_node_id |
string | Choose the nugget in the scoring branch. |
model_build_node_id |
string | Choose the modeling node in the flow. |