The Workflow Automation Script Editor
In the Workflow Automation Script Editor, you can work with scripts using either the:
- Graphical view, or
- XML view.
Graphical view
On the Graphical View tab, you can add multiple operations, which are executed in their numerical order. You can define and change the order of the operations and you can use commands to execute an operation on different objects or a set of objects (using Add New Parameter and Add Flow Control).
Changing the operation order
To change the order of the operations, select an operation and drag to the position in which you want it executed.
Expanding steps
To expand a step, click on the blue arrows on the right. When expanded, the corresponding workflow form is displayed, where you can specify the parameters for the operation.
Validating and running scripts
To include the operation in the execution, select the check box in front of the operation.
To check the script for errors, click Validate at the bottom of the form. If no errors are encountered (check the Output Information pane), click Apply to execute the script.
Adding operations to the script
To add operations to the script, right-click in the Graphical View window. The following options are available:
Add New Operation Select a specific operation from a predefined list and add to the script. The list includes petrophysical and facies property (trend) modeling, surface operations, 2D mapping, volumetrics and filters, among others.
Add New Message Add an Info or Log Message to the script. Messages are recorded in the Output Information pane. (To see messages, make sure the correct view filter is selected for the Output Information pane).
Add Flow Control Adds an operation that is executed on a group of objects. It adds a ‘foreach’ item to the script where you can define the type and content of the group. You can place operations in the 'foreach' loop and when the script is executed, these operations run on each item of the group defined in the 'foreach' item. See Add flow control function.
Add New Parameter Option to re-run an existing script on a different object. A global parameter card is added to the script. The Parameter card identifies the script as a general script for all objects in the JewelExplorer that belong to the Type selected in the ‘Add Parameter’ settings. You should add the Parameter card in the script before the operation that you want to rerun with another object. Scripts with a Parameter card can be directly accessed by objects of the correct parameter Type from the JewelExplorer. See Add flow control function. More than one Parameter card can be added to a single script, for instance for different Types.
Add New Script Adds an existing script as a step in the current script.
Test Script Runs a validation of the script. The results of the validation are displayed in the Output Information pane.
Execute Script Runs the script, this is the same as clicking Apply.
Copy Selection Copies the selected script.
Paste Selection Pastes a copied script into the Graphical View.
Remove Selection Removes selected operation.
Copying operations for scripting
Where applicable, you can copy an operation into a script from the Audit Trail view
- Open the Audit Trail view (Home > Audit Trail > Open).
- Click the operation's icon in the Audit Trail form and drag the operation into the Graphical View.
Example
Right-click in an empty area of the Graphical View pane in the Workflow Automation script editor, and select Add New Operation > Surface operations > Arithmetic Operations > Z=Z + Distance. Expand the operation in the script editor, select the surface to change, and set the distance. Click Validate and then click Apply.
Add parameter
Typically, you define a modeling script for a specific object that you select in the operation settings. With the Add New Parameter option, you can define a script as a general (global) script for all objects of a specific type. You define a parameter card for a certain object type and specify the following information:
- Name The name of the parameter card. Enter or select a name. The name is automatically added to the selection list of all relevant operations that you want to define in the script. This enables you to select the parameter card name as the reference to any other object of the selected type on which you want to carry out the operation.
- Type Object type for which the parameter card is defined. All operations in the script that use the selected object type can refer to the parameter card, and all objects that belong to the type will be able to access and run the script.
- Object Object for which an operation in the script is currently defined. This is the only variable in a parameter card. When you (later) want to rerun the script on another object of the same type, you will be asked to select an object. That object becomes the currently selected object in the parameter card.
With Add Flow Control, you can define an operation to execute on a group of objects. You select a group that includes all relevant objects, or, if necessary, create the group in a prior step of the workflow. Next, you define one or more operations to run on all members of the group.
The Add Flow Control function adds a foreach and end loop to the listed script. You drag the operations to executed between these commands.