This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bizweaver:wf_var [2024/09/24 13:32] dlee [Introduction (Using Variables)] |
bizweaver:wf_var [2024/09/24 13:54] (current) dlee [String Manipulation] |
||
|---|---|---|---|
| Line 12: | Line 12: | ||
| * Use drag & drop to place variable in your tool configuration. | * Use drag & drop to place variable in your tool configuration. | ||
| - | {{ : | + | {{ : |
| - | ====== What are Bizweaver Variables? ====== | ||
| - | **“Variables”** are data values held in memory during the execution of a workflow. There are two types of variables in Bizweaver: **User Variables** and **Step Variables**. | + | ===== Variables |
| - | **“[[bw2: | + | The **Variables** |
| - | **“[[bw2:using_variables# | + | {{ :bw2:bizweavervartool1.png? |
| - | Bizweaver variables are available to other workflow steps that follow the step where they are created. | ||
| - | |||
| - | ====== Variables Tool ====== | ||
| - | |||
| - | The **Variables** tool can establish constant/ | ||
| - | |||
| - | {{ : | ||
| * “Name” is the name of the variable. | * “Name” is the name of the variable. | ||
| * " | * " | ||
| - | + | | |
| - | <WRAP center round tip 50%> | + | |
| - | New in Bizweaver version 2.4 | + | |
| - | </ | + | |
| - | + | ||
| - | * Click on the **X** at the right-end of a row to delete a variable. | + | |
| - | | + | |
| Following are examples of using variables. | Following are examples of using variables. | ||
| Line 50: | Line 36: | ||
| * The __value__ field is blank because the value to be used will be sent in the API call to Bizweaver. | * The __value__ field is blank because the value to be used will be sent in the API call to Bizweaver. | ||
| - | {{ : | + | {{ : |
| The variable is then referenced in a subsequent SQL: Reader step. | The variable is then referenced in a subsequent SQL: Reader step. | ||
| * Any time a variable is referenced using <F4> in a SQL step, the string must be enclosed in single quotes as shown. | * Any time a variable is referenced using <F4> in a SQL step, the string must be enclosed in single quotes as shown. | ||
| - | {{ : | + | {{ : |
| ====Example 2===== | ====Example 2===== | ||
| Line 62: | Line 48: | ||
| * In this case, the __values__ are static. | * In this case, the __values__ are static. | ||
| - | {{ : | + | {{ : |
| The variables are then referenced in a subsequent WebService2 tool step as shown. | The variables are then referenced in a subsequent WebService2 tool step as shown. | ||
| - | {{ : | + | {{ : |
| - | ===== Calculations in Variables ===== | ||
| - | Arithmetic calculations can be applied to a numeric variable during workflow execution. This functionality is introduced in Bizweaver version 2.1.0. | + | ====Example 3===== |
| + | <WRAP center round tip 80%> | ||
| + | Arithmetic calculations can be applied to a numeric variable during workflow execution. | ||
| A calculation using a variable is done by using the “EVAL{}” function in the “Value” of the variable. The calculation can be done against both user and step variables. The calculation is placed within the braces {} as shown in the examples. | A calculation using a variable is done by using the “EVAL{}” function in the “Value” of the variable. The calculation can be done against both user and step variables. The calculation is placed within the braces {} as shown in the examples. | ||
| + | </ | ||
| - | Everyday use of this functionality is to maintain a counter to control processing or document processing. The calculation will typically be placed inside of a loop construct. | ||
| - | |||
| - | ====Example 3===== | ||
| Following is a simple example of how a “counter” calculation is defined. We want to know how many records were passed into a loop from an SQLCommand step in this case. For this example, we will use a simple statement. | Following is a simple example of how a “counter” calculation is defined. We want to know how many records were passed into a loop from an SQLCommand step in this case. For this example, we will use a simple statement. | ||
| Line 107: | Line 92: | ||
| - | ====== Step Variables | + | ===== Step Variables ===== |
| Step variables are created by Bizweaver and do not require any user action. These variables are available as soon as a step has been executed. | Step variables are created by Bizweaver and do not require any user action. These variables are available as soon as a step has been executed. | ||
| Line 135: | Line 120: | ||
| When the file writer step sees the same step variable, the next record will be returned from the SQL select statement or C2 received from the loop processing. This cycle continues for each record read into the loop processing. | When the file writer step sees the same step variable, the next record will be returned from the SQL select statement or C2 received from the loop processing. This cycle continues for each record read into the loop processing. | ||
| - | ====== Using Variables ====== | ||
| - | The following image illustrates how variables are selected. This process is used in all instances where some variable needs to be referenced. The list of available workflow steps will get larger as you progress through additional steps in the workflow. | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | |||
| - | - Position the cursor in the field where the variable is needed. | ||
| - | - Press **F4** | ||
| - | - The ‘Choose Variable” flyout is opened. | ||
| - | - Workflow steps before the current one are listed in the right-hand panel. | ||
| - | - Click on the appropriate step name. | ||
| - | - Available variables for the selected step are expanded for the step in the right-hand panel. | ||
| - | - Select the desired variable and double click. | ||
| - | <WRAP left round tip> | ||
| - | When variables are used, they have a particular name structure, as shown in the **// | ||
| - | |||
| - | </ | ||
| - | |||
| - | ====== Examples ====== | ||
| - | |||
| - | Once a variable has been created, it can be used in any subsequent workflow step. | ||
| - | |||
| - | ===== User Variable Example ===== | ||
| - | |||
| - | In a Bizweaver workflow, a user can reference variables initiated earlier in the workflow using the variables selector. In this example, a SQL statement is being used to pull information from the database. We want to limit the data based on a certain value. In this example, a value from the “Variables” step is used. | ||
| - | |||
| - | When processed, the below workflow will only pull the CardType of " | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | In the variables tool, there is a **User-Defined Variable ** of " | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | In the SQL tool step, you can reference the **User-Defined Variable** of " | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | So, the SQL statement now uses the value ‘C’ in the variable “UserVariable1.” | ||
| - | |||
| - | {{ : | ||
| - | Since the variable value ‘C’ is a string (text), the variable name must be enclosed in single quotes as required by SQL. | ||
| - | ===== Step Variable | + | ==== Example |
| In this example, we are writing the output of the SQL step to a file. | In this example, we are writing the output of the SQL step to a file. | ||
| Line 194: | Line 137: | ||
| Next, you will press [F4] and select the SQL step variables when going to the file writer step. | Next, you will press [F4] and select the SQL step variables when going to the file writer step. | ||
| - | {{ :bw2:bizweavervarmanager3.png |}} | + | {{ :bizweaver:wf_var02.png |}} |
| You can see each step variable in the " | You can see each step variable in the " | ||
| Line 203: | Line 146: | ||
| =====String Manipulation===== | =====String Manipulation===== | ||
| - | Starting in Bizweaver 2.7.2, the functionality to modify variables was introduced. | + | This allows a user to manipulate all variables that are inserted in a specific step and is accessed by pressing F4 |
| - | {{ :bw2:bizweavervarmanager1.png |}} | + | {{ :bizweaver:wf_var03.png |}} |
| * **Escape:** Selecting this checkbox will enable or disable the escaping functionality. | * **Escape:** Selecting this checkbox will enable or disable the escaping functionality. | ||