Jump to: navigation, search

Difference between revisions of "Activity:OpenExternal (Activity)"


(Created page with "{{ActivityInfoBox | title = Open External Document | name = OpenExternalDocument | image = | imagecaption = Activity OpenExternalDocument | purpose = Open an external documen...")
 
(Open image file with explicit application)
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
The OpenExternal Activity opens an external document or executable file, also using optional arguments.
 +
 +
=Description=
 
{{ActivityInfoBox
 
{{ActivityInfoBox
| title = Open External Document
+
| title = Open External
| name = OpenExternalDocument
+
| name = OpenExternal
 
| image =  
 
| image =  
| imagecaption = Activity OpenExternalDocument
+
| imagecaption = Activity OpenExternal
 
| purpose = Open an external document or executable file
 
| purpose = Open an external document or executable file
 
| category = UBIK File Primitives
 
| category = UBIK File Primitives
| returns = success of openeing document
+
| returns = success of opening the file
 
| version = 2.4+
 
| version = 2.4+
 
}}
 
}}
The OpenExternalDocument Activity opens an external document or executable file combined with optional arguments.
 
  
==Arguments==
+
===Arguments===
  
 
{| class="wikitable sortable" | width = "50%"
 
{| class="wikitable sortable" | width = "50%"
Line 17: Line 19:
 
! Argument !! Type !! Direction !! Purpose  
 
! Argument !! Type !! Direction !! Purpose  
 
|- align="left"
 
|- align="left"
| string|| FileName || In || The path to the executable file or the document file.
+
| FileName|| {{String_MSDN}} || In || The path to the executable or the document file.
 
|- align="left"
 
|- align="left"
| string|| Arguments|| In || Additional arguments to use (optional, used to pass arguments for executable files).
+
| Arguments|| {{String_MSDN}}|| In || Additional arguments (optional, used to pass arguments for executable files).
 
|- align="left"
 
|- align="left"
| string|| WorkingDirectory|| In || Working directory (optional, used to specify a working directory for executable files). This value only has effect together with executable files.
+
| WorkingDirectory|| {{String_MSDN}} || In || Working directory (optional, used to specify a working directory for executable files). This value is only used in combination with executable files.
 
|- align="left"
 
|- align="left"
| int|| TimeOut|| In || Time out value in seconds (optional, to wait for a maximum amount of time for the invoked process to finish). Leaving this value empty or setting it to 0 means that the workflow continues execution immediately, otherwise the specified amount of seconds will be spent waiting for the process to finish.
+
| TimeOut|| {{Int32_MSDN}} || In || Time out value in seconds (optional, to wait for a maximum amount of time for the invoked process to finish). Leaving this value empty or setting it to 0 means that the workflow continues execution immediately, otherwise the specified amount of seconds will be spent waiting for the process to finish.
 
|- align="left"
 
|- align="left"
| Result|| int|| Out || 1 if process successfully finished, 0 if not
+
| Result|| {{Boolean_MSDN}}|| Out || true if process successfully finished, false if not
 
|}
 
|}
  
==Usage==
+
===Usage===
 +
The activity is used to open file documents or executable files during the execution of a workflow. It can be used to open and show documents like Excel files, JPG pictures etc but also to execute a batch file if needed.
  
This activity is used to open file documents or executable files during the execution of a workflow. This activity can be used for showing documents like Excel files, JPG Pictures etc. It can also be used to execute a batch file if needed.
+
{{Attention|Opening any (proprietary) document type requires that a corresponding application is available on the machine, for example Microsoft Office for an Excel document.}}
  
{{Attention|This activity does not automatically save changes. If you want to persist the newly created instance, you need i.e. a subsequent [[Activity SaveObject|SaveObject activity]]!}}
+
=Examples=
 
+
===Open an Excel document===
==Example==
+
 
Show the Excel file ''E:\Results.xlsx'':
 
Show the Excel file ''E:\Results.xlsx'':
  
Line 44: Line 46:
 
|}
 
|}
  
==Example==
+
===Open image file with explicit application===
 
Show the graphics image file ''E:\Graph.jpg'' with a certain image viewer application that allows to pass the additional command line argument "/clipcopy" which copies the loaded picture to the clipboard. Therefore, the needed arguments are simply separated by space characters, consisting of the image file path and the additional argument.
 
Show the graphics image file ''E:\Graph.jpg'' with a certain image viewer application that allows to pass the additional command line argument "/clipcopy" which copies the loaded picture to the clipboard. Therefore, the needed arguments are simply separated by space characters, consisting of the image file path and the additional argument.
  
Line 51: Line 53:
 
! Argument!! Value
 
! Argument!! Value
 
|- align="left"
 
|- align="left"
| string|| FileName || ''""C:\Program Files (x86)\IrfanView\i_view32.exe""''
+
| string|| FileName || ''"C:\Program Files (x86)\IrfanView\i_view32.exe"''
 
|- align="left"
 
|- align="left"
 
| string|| Arguments|| ''"E:\Graph.jpg /clipcopy"''
 
| string|| Arguments|| ''"E:\Graph.jpg /clipcopy"''
 
|}
 
|}
  
==Example==
+
===Open image file with default application===
 
Alternatively to the previous example, showing the image ''E:\Graph.jpg'' with it's system default application can simply be done by specifying it's document path as the file name.
 
Alternatively to the previous example, showing the image ''E:\Graph.jpg'' with it's system default application can simply be done by specifying it's document path as the file name.
 
{| class="wikitable" | width = "50%"
 
{| class="wikitable" | width = "50%"
Line 65: Line 67:
 
|}
 
|}
  
==Example==
+
===Execute a batch file with command line arguments===
 
Another use case could be executing batch files. We have a batch file ''E:\ProcessData.bat'' that processes the data of the text file ''MyData.csv'' in the working directory "E:\". If there is a problem we want to specify a timeout of 30 seconds for this processing step to avoid blocking the workflow for a long time.
 
Another use case could be executing batch files. We have a batch file ''E:\ProcessData.bat'' that processes the data of the text file ''MyData.csv'' in the working directory "E:\". If there is a problem we want to specify a timeout of 30 seconds for this processing step to avoid blocking the workflow for a long time.
  
Line 81: Line 83:
 
| string|| TimeOut|| ''30''
 
| string|| TimeOut|| ''30''
 
|}
 
|}
 +
 +
<headertabs />
  
 
==See also==
 
==See also==
 
* [[Workflow Designer]]
 
* [[Workflow Designer]]
* [[SaveObject (Activity)]]
+
* [[Activity:SaveObject (Activity)]]
  
[[Category:Workflows]] [[Category:Activities]]
+
[[Category:Activities]]

Latest revision as of 17:15, 4 March 2015

The OpenExternal Activity opens an external document or executable file, also using optional arguments.

[edit]

Description

Open External
Name OpenExternal
Purpose Open an external document or executable file
Category UBIK File Primitives
Returns success of opening the file
Version 2.4+

Arguments

Argument Type Direction Purpose
FileName String In The path to the executable or the document file.
Arguments String In Additional arguments (optional, used to pass arguments for executable files).
WorkingDirectory String In Working directory (optional, used to specify a working directory for executable files). This value is only used in combination with executable files.
TimeOut Integer In Time out value in seconds (optional, to wait for a maximum amount of time for the invoked process to finish). Leaving this value empty or setting it to 0 means that the workflow continues execution immediately, otherwise the specified amount of seconds will be spent waiting for the process to finish.
Result Boolean Out true if process successfully finished, false if not

Usage

The activity is used to open file documents or executable files during the execution of a workflow. It can be used to open and show documents like Excel files, JPG pictures etc but also to execute a batch file if needed.

IC Attention.pngOpening any (proprietary) document type requires that a corresponding application is available on the machine, for example Microsoft Office for an Excel document.

Examples

Open an Excel document

Show the Excel file E:\Results.xlsx:

Argument Value
string FileName "E:\Results.xlsx"

Open image file with explicit application

Show the graphics image file E:\Graph.jpg with a certain image viewer application that allows to pass the additional command line argument "/clipcopy" which copies the loaded picture to the clipboard. Therefore, the needed arguments are simply separated by space characters, consisting of the image file path and the additional argument.

Argument Value
string FileName "C:\Program Files (x86)\IrfanView\i_view32.exe"
string Arguments "E:\Graph.jpg /clipcopy"

Open image file with default application

Alternatively to the previous example, showing the image E:\Graph.jpg with it's system default application can simply be done by specifying it's document path as the file name.

Argument Value
string FileName "E:\Graph.jpg"

Execute a batch file with command line arguments

Another use case could be executing batch files. We have a batch file E:\ProcessData.bat that processes the data of the text file MyData.csv in the working directory "E:\". If there is a problem we want to specify a timeout of 30 seconds for this processing step to avoid blocking the workflow for a long time.

This can be done by defining the following arguments:

Argument Value
string FileName "E:\ProcessData.bat"
string Arguments "E:\MyData.csv"
string WorkingDirectory "E:\"
string TimeOut 30

See also