Changes

Activity:OpenExternal (Activity)

3,669 bytes added, 15:28, 11 November 2014
Created page with "{{ActivityInfoBox | title = Open External Document | name = OpenExternalDocument | image = | imagecaption = Activity OpenExternalDocument | purpose = Open an external documen..."
{{ActivityInfoBox
| title = Open External Document
| name = OpenExternalDocument
| image =
| imagecaption = Activity OpenExternalDocument
| purpose = Open an external document or executable file
| category = UBIK File Primitives
| returns = success of openeing document
| version = 2.4+
}}
The OpenExternalDocument Activity opens an external document or executable file combined with optional arguments.

==Arguments==

{| class="wikitable sortable" | width = "50%"
|-
! Argument !! Type !! Direction !! Purpose
|- align="left"
| string|| FileName || In || The path to the executable file or the document file.
|- align="left"
| string|| Arguments|| In || Additional arguments to use (optional, used to pass arguments for executable files).
|- 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.
|- 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.
|- align="left"
| Result|| int|| Out || 1 if process successfully finished, 0 if not
|}

==Usage==

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|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]]!}}

==Example==
Show the Excel file ''E:\Results.xlsx'':

{| class="wikitable" | width = "50%"
|-
! Argument!! Value
|- align="left"
| string|| FileName || ''"E:\Results.xlsx"''
|}

==Example==
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.

{| class="wikitable" | width = "50%"
|-
! Argument!! Value
|- align="left"
| string|| FileName || ''""C:\Program Files (x86)\IrfanView\i_view32.exe""''
|- align="left"
| string|| Arguments|| ''"E:\Graph.jpg /clipcopy"''
|}

==Example==
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%"
|-
! Argument!! Value
|- align="left"
| string|| FileName || ''"E:\Graph.jpg"''
|}

==Example==
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:
{| class="wikitable" | width = "50%"
|-
! Argument!! Value
|- align="left"
| string|| FileName || ''"E:\ProcessData.bat"''
|- align="left"
| string|| Arguments|| ''"E:\MyData.csv"''
|- align="left"
| string|| WorkingDirectory|| ''"E:\"''
|- align="left"
| string|| TimeOut|| ''30''
|}

==See also==
* [[Workflow Designer]]
* [[SaveObject (Activity)]]

[[Category:Workflows]] [[Category:Activities]]
681
edits