The following are typical use cases for the placeholder functionality.
Expose Basic Workflow Component Properties to optiSLang App Users
You can use placeholders to directly expose basic workflow component properties for external modification (for example, by a user of an optiSLang App or the command line interface). Use cases in this category include:
Selecting the Load-case
You can implement multiple load-cases for a workflow/analysis by using different script or input files which contain a specific load-case. Using placeholders, you can expose the selection of the load-case file so it can be modified externally. The end-user then selects the file to execute a certain load-case.
The following example uses the Text Input node.
Create or use two different text input files (for example load_case_1.inp and load_case_2.inp).
From the Modules pane, drag a Text Input node onto the Scenery pane and let it drop.
If a Text Input node is already available in the project you can skip this step.
Double-click the Text Input node to open the dialog box.
To load one of the text input files, click .
Browse to the location of the text input file, select it, and click
.The input file is loaded.
To save the changes and close the dialog box, click
.To open the Project overview dialog box, select > from the menu bar.
Navigate to the FilePath property of the Text Input node.
Drag the FilePath property to the project placeholders table.
In the Minimum user level cell, set the value to to expose the placeholder to the end-user.
To save the changes and close the dialog box, click
.To use this project in an optiSLang App, save it as an application.
Workflow Component Concurrency
Many workflow components share a property which specifies the concurrency (maximum executions in parallel). You can expose this property using a placeholder so it can be modified externally. The end-user is then able to modify this specific concurrency property of a certain component without having to edit the whole workflow.
The following example uses the Batch Script node.
From the Modules pane, drag a Batch Script node onto the Scenery pane and let it drop.
If a Batch Script node is already available in the project you can skip this step.
To open the Project overview dialog box, select > from the menu bar.
Navigate to the MaxParallel property of the Batch Script node.
Drag the MaxParallel property to the project placeholders table.
In the Minimum user level cell, set the value to to expose the placeholder to the end-user.
To save the changes and close the dialog box, click
.To use this project in an optiSLang App, save it as an application.
Expose Specific Parts of Batch/Bash Script Node Contents to optiSLang App Users
You can use placeholders to directly expose parts of complex workflow component properties for external modification (for example, by a user of an optiSLang App or the command line interface). A common use-case is to expose parts of batch/bash scripts to the end-user. Instead of specifying a placeholder for the whole script content or file, the end-user is then able to modify only the desired part of the script. This is done using Placeholder Macro Expression Language which allows you to nest placeholders. For each of the nested placeholders, the minimum user level can be set independently.
The following example uses the Batch Script node.
From the Modules pane, drag a Batch Script node onto the Scenery pane and let it drop.
If a Batch Script node is already available in the project you can skip this step.
Double-click the Batch Script node to open the dialog box.
In the Script tab, enter the following:
@echo off SET a = world SET b = universe echo hello %a
To save the changes and close the dialog box, click
.To open the Project overview dialog box, select > from the menu bar.
Navigate to the Content property of the Batch Script node.
Drag the Content property to the project placeholders table.
Leave the minimum user level at Flow Engineer so that the entire script content is not exposed to the end-user.
Create a new placeholder:
Double-click the Id cell in an empty row of the table and enter
p1
.In the Minimum user level cell, set the value to ..
Double-click the Value cell and set the type to .
In the Expression field, enter
b
.
Double-click the Value cell of the Content placeholder.
Select the Expression check box.
Click
( )Change the expression to:
@echo off SET a = world SET b = universe echo hello %$(p1)
To save the expression changes and close the dialog box, click
.To save the placeholder changes and close the dialog box, click
.
Expose Full Project or System Parameters to optiSLang App Users
The previous method can even be used to expose parts of even more complex properties, for example the parametrization of analysis systems or the project. A common use-case is to expose the reference values of a desired set of parameters to the end user.
The following example uses the Sensitivity system.
From the Modules pane, drag a Sensitivity system onto the Scenery pane and let it drop.
If a Sensitivity system is already available in the project you can skip steps 1-4.
Double-click the Sensitivity system to open the dialog box.
Add parameters by right-clicking in the Parameter tab and selcting from the context menu, or by importing them from another system or file.
To save the changes and close the dialog box, click
.To open the Project overview dialog box, select > from the menu bar.
Navigate to the ParameterManager property of the Sensitivity system.
Drag the ParameterManager property to the project placeholders table.
Leave the minimum user level at Flow Engineer so that the entire script content is not exposed to the end-user.
Create a new placeholder:
Double-click the Id cell in an empty row of the table and enter
p1_ref_value
.In the Minimum user level cell, set the value to ..
Double-click the Value cell and set the type to .
In the Expression field, enter
5
.
Double-click the Value cell of the ParameterManager placeholder.
Select the Expression check box.
Click
( )Change the expression to:
{ "correlations" : [], "parameter_container" : [ { "active" : true, "const" : false, "deterministic_property" : { "domain_type" : { "enum" : [ "uninitialized", "bool", "real", "integer", "string", "variant" ], "value" : "real" }, "kind" : "continuous", "lower_bound" : 0.10000000000000001, "upper_bound" : 20.0 }, "id" : "cbdd72e2-7179-4a7f-b64e-6a2caed4ade6", "modifiable" : false, "name" : "area01", "reference_value" : $(p1_ref_value), "removable" : true, "type" : { "enum" : [ "deterministic", "stochastic", "mixed", "dependent" ], "value" : "deterministic" }, "unit" : "" }, { "active" : true, "const" : false, "deterministic_property" : { "domain_type" : { "enum" : [ "uninitialized", "bool", "real", "integer", "string", "variant" ], "value" : "real" }, "kind" : "continuous", "lower_bound" : 0.10000000000000001, "upper_bound" : 20.0 }, "id" : "d4832619-f878-454e-a85a-b3d197675410", "modifiable" : false, "name" : "area02", "reference_value" : 10.0, "removable" : true, "type" : { "enum" : [ "deterministic", "stochastic", "mixed", "dependent" ], "value" : "deterministic" }, "unit" : "" }, { "active" : true, "const" : false, "deterministic_property" : { "domain_type" : { "enum" : [ "uninitialized", "bool", "real", "integer", "string", "variant" ], "value" : "real" }, "kind" : "continuous", "lower_bound" : 0.10000000000000001, "upper_bound" : 20.0 }, "id" : "9df0cb60-cb51-49cf-82e8-7fd24c269ff4", "modifiable" : false, "name" : "area03", "reference_value" : 10.0, "removable" : true, "type" : { "enum" : [ "deterministic", "stochastic", "mixed", "dependent" ], "value" : "deterministic" }, "unit" : "" } ] }
To save the expression changes and close the dialog box, click
.To save the placeholder changes and close the dialog box, click
.