transformations:runprogram
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
transformations:runprogram [2016/09/20 23:20] – dmitry | transformations:runprogram [2021/06/20 20:24] – craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Run program | + | {{ transformations: |
+ | ====== | ||
+ | Category: Workflow / External\\ | ||
- | Run specified external application, and wait until it finishes. | + | \\ |
+ | =====Description===== | ||
+ | This action runs a specified external application and waits until it finishes. | ||
If no external application is provided the command line is executed by the Windows shell (cmd.exe). | If no external application is provided the command line is executed by the Windows shell (cmd.exe). | ||
- | The transformation | + | The action |
- | ===Use cases=== | + | \\ |
+ | =====Use cases===== | ||
* Run external applications (e.g. after a file is generated by EasyMorph). | * Run external applications (e.g. after a file is generated by EasyMorph). | ||
* Execute Windows shell commands (copy, del, ren, etc.). | * Execute Windows shell commands (copy, del, ren, etc.). | ||
* Run other EasyMorph projects in order to make them generate reports. | * Run other EasyMorph projects in order to make them generate reports. | ||
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^ Setting | ||
+ | |Application< | ||
+ | |Working directory (optional)< | ||
+ | |Arguments|Enter the values, filenames, commands, etc. passed to the application as either static text or a calculated\\ string. | ||
+ | |Halt if exit code is not 0|When this is checked, the workflow will stop and display an error if the run program terminates with an error.| | ||
+ | |Capture output|When checked, EasyMorph will capture any returned data in a dataset (e.g., to see errors). | ||
+ | < | ||
- | ===Capturing output=== | + | \\ |
- | It is possible to capture STDOUT and STDERR of the executed external application or Windows shell command. For instance it is possible to run //dir// and capture its output as a table in EasyMorph, or forward output of an application into EasyMorph without creating a temporary intermediate CSV file. STDERR is captured in a separate column, which can later be used for error-handling routines. Since EasyMorph also outputs errors into STDERR this feature can be used for error handling of EasyMorph projects executed in the command line mode. | + | ====Argument options==== |
+ | ^ Option | ||
+ | |Text|Enter static text arguments.| | ||
+ | |Calculated|Enter an expression to calculate the argument string.| | ||
+ | Incorporating parameters is supported in both options (e.g., {MyParam}). | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | |||
+ | ====Parameter substitution==== | ||
+ | The action allows defining its command line as static text or as a calculated expression. It is possible to insert [[: | ||
+ | |||
+ | copy /Y {SourceFileName} {DestinationFileName} | ||
+ | |||
+ | The command line above is equivalent to the calculated expression below but is easier to use. | ||
+ | |||
+ | “copy /Y “ & {SourceFileName} & “ “ & {DestinationFileName} | ||
+ | |||
+ | // | ||
+ | |||
+ | \\ | ||
+ | ====Capturing output==== | ||
+ | It is possible to capture STDOUT and STDERR of the executed external application or Windows shell command. For instance, it is possible to run //dir// and capture its output as a table in EasyMorph, or forward | ||
+ | |||
+ | STDERR is captured in a separate column, which can later be used for error-handling routines. Since EasyMorph also outputs errors into STDERR this feature can be used for error handling of EasyMorph projects executed in the command line mode. | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | **EXAMPLE 1:** Running the external 7-Zip program to unzip a file or files. | ||
+ | |||
+ | **Action parameters** | ||
+ | > Application " | ||
+ | > Working directory is " | ||
+ | > Calculated argument ' e "' | ||
+ | > Halt if exit code is not 0 is checked (the workflow will stop with an error if 7-Zip does not complete correctly) | ||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | \\ | ||
+ | **EXAMPLE 2:** Run the Windows shell command to copy a file. | ||
+ | |||
+ | **Action parameters** | ||
+ | > Application is left blank (the Windows shell will run the command below) | ||
+ | > Calculated argument is the shell command: | ||
+ | > Hard if exit code is not 0 is checked (the workflow will stop with an error if the copy command does not complete successfully) | ||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | |||
+ | * [[transformations: | ||
+ | * [[https:// | ||
- | ===See also=== | ||
- | [[http:// |
transformations/runprogram.txt · Last modified: 2021/07/19 01:59 by craigt