Scenario
Sometimes it is useful to invoke a Windows (or Unix) executable from within a workflow. This might be needed if the only way to integrate with a particular system is via an executable, or perhaps the only way to generate a particular type of file is using an executable.
This is quite simple to achieve, using Avoka's ExecutableInvoker component.
The example we present below uses ExecutableInvoker to copy a series of files from one directory to another. This is just a simple example, since all Windows users will already have the xcopy command on their systems - replace xcopy with the command of your choice.
Workflow
The workflow is shown below:

| Executable name |
This is the name of the executable. It must either exist on the system path, or use an explicit pathname. |
| Invocation Parameters |
These are any additional parameters to the executable.
In the case of "xcopy", we are providing the source and destination directories, and the /Y parameter.
/Y means - don't prompt if a destination file already exist.
You may insert xpath parameters by clicking on the "..." button |
| Invocation Output |
This is a string variable that will hold the results of the command.
In the case of xcopy, this will be a string containing a list of the files copied. |
You can download this process here (right click and "Save target...")
ExecutableInvoker Sample.1.0.xml
You must install the Executable Invoker component first, which you can download from:
http://www.avoka.com/avoka/escomponents.shtml
Warnings
- Invoking an executable should generally only be used during prototyping, or as a last resort if no other method of integration is possible. The reason for this is that the executable that is launched is largely running "unattended". If anything should go wrong - for example, if the executable attempts to prompt the user for input - then it will just stop processing, and both the executable itself, and the workflow, will be "hung". This will require system administrator intervention to correct. If many workflows are running simultaneously, this may eventually consume a large amount of memory. Therefore, if you're using ExecutableInvoker, please test carefully, and ensure that your executable is always running in a "no intervention required" mode.
- DOS commands, batch files, and scripts may not run using Executable Invoker.
Future enhancements
- Ability to "kill" the process if it hasn't returned by a specified amount of time.
- Return executable return code
- Return executable standard-error string
Please email info@avoka.com if you require any of these enhancements.