-
-
Notifications
You must be signed in to change notification settings - Fork 168
Local Variables
Akram El Assas edited this page Nov 1, 2022
·
1 revision
It is possible to declare local variables in a workflow.
The syntax is as follows:
<Workflow xmlns="urn:wexflow-schema" id="115" name="Workflow_FilesLoaderLocalVariables" description="Workflow_FilesLoaderLocalVariables">
<Settings>
<Setting name="launchType" value="trigger" />
<Setting name="enabled" value="true" />
</Settings>
<LocalVariables>
<Variable name="myFile1" value="C:\WexflowTesting\file1.txt" />
<Variable name="myFile2" value="C:\WexflowTesting\file2.txt" />
<Variable name="myFile3" value="C:\WexflowTesting\file3.txt" />
</LocalVariables>
<Tasks>
<Task id="1" name="FilesLoader" description="Loading files" enabled="true">
<Setting name="file" value="$myFile1" />
<Setting name="file" value="$myFile2" />
<Setting name="file" value="$myFile3" />
</Task>
<Task id="2" name="ListFiles" description="Listing files" enabled="true">
</Task>
</Tasks>
</Workflow>
When Wexflow server loads the workflow file, the workflow file will be parsed and thus the local variables will be replaced by their respective values.
It is also possible to combine global variables with local variables, here is an example:
GlobalVariables.xml:
<?xml version="1.0" encoding="utf-8" ?>
<GlobalVariables>
<Variable name="wexflowTesting" value="C:\WexflowTesting" />
<Variable name="fileName1" value="file1.txt" />
<Variable name="fileName2" value="file2.txt" />
<Variable name="fileName3" value="file3.txt" />
</GlobalVariables>
Below a sample workflow which contains global variables and local variables:
<Workflow xmlns="urn:wexflow-schema" id="115" name="Workflow_FilesLoaderLocalVariables" description="Workflow_FilesLoaderLocalVariables">
<Settings>
<Setting name="launchType" value="trigger" />
<Setting name="enabled" value="true" />
</Settings>
<LocalVariables>
<Variable name="myFile1" value="$wexflowTesting\$fileName1" />
<Variable name="myFile2" value="$wexflowTesting\$fileName2" />
<Variable name="myFile3" value="$wexflowTesting\$fileName3" />
</LocalVariables>
<Tasks>
<Task id="1" name="FilesLoader" description="Loading files" enabled="true">
<Setting name="file" value="$myFile1" />
<Setting name="file" value="$myFile2" />
<Setting name="file" value="$myFile3" />
</Task>
<Task id="2" name="ListFiles" description="Listing files" enabled="true">
</Task>
</Tasks>
</Workflow>
Copyright © Akram El Assas. All rights reserved.
- Installing
- Screenshots
- Docker
- Configuration
- Persistence Providers
- Getting Started
- Android App
- Samples
-
Built-in Tasks
- File system tasks
- Encryption tasks
- Compression tasks
- Iso tasks
- Speech tasks
- Hashing tasks
- Process tasks
- Network tasks
- XML tasks
- SQL tasks
- WMI tasks
- Image tasks
- Audio and video tasks
- Email tasks
- Workflow tasks
- Social media tasks
- Waitable tasks
- Reporting tasks
- Web tasks
- Script tasks
- JSON and YAML tasks
- Entities tasks
- Flowchart tasks
- Approval tasks
- Notification tasks
- SMS tasks
- Local Variables
- Global Variables
- REST Variables
- Cron Scheduling
- Logging
- Custom Tasks
- Command Line Client
- RESTful API
- Run from Source