# File Management
The File Management actions provide various activities related to file management including the creation, reading, updating and deleting of files and directories.
# File Action Scenarios
File action scenarios are defined within “FileIO.Config.xml”
<fileioconfig>
<!-- Configure these scenarios with real domain user accounts -->
<scenario name="test" username="pmgio_test" domain="PMGNETDEV" password="_ENCRYPTED_PASSWORD_HERE_"></scenario>
<!-- leave the username attribute empty to use the Workflow Engine account for File IO -->
<scenario name="system" username="" domain="" password=""></scenario>
</fileioconfig>
# Append File
Action Function: The File Append activity will either add data to an existing file, or if the file does not exist a new one will be created.
Action Outputs:
Failure – There was an error in the attempt to append or create the file
Success – The file was updated
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
File Path (Required)
This property specifies the full local or UNC path of the file.
File Data (Required)
This property specifies the body of the file that will be appended.
Error Message
A variable to set messages for any errors encountered.
# Copy File
Action Function: The File Copy activity will copy an existing file from one location to another.
Action Outputs:
Failure – There was an error in the attempt to copy the file to a new location
Success – The file was copied to a new location
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Source Path (Required)
This property specifies the full local or UNC path of the file to be copied.
Destination Path (Required)
This property specifies the full local or UNC path the file should be copied to.
Overwrite (Required)
This property specifies whether or not a file should be overwritten if one is found in the destination path with the same name.
Error Message
A variable to set messages for any errors encountered.
# Create Directory
Action Function: The Directory Create activity enables the creation of a new directory at a specified location.
Action Outputs:
Failure – The action failed to create the directory
Success – The directory was created
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Directory Path (Required)
This property specifies the full local or UNC path where the directory should be created.
Error Message
A variable to set messages for any errors encountered.
# Create Document
Action Function: The Create Document activity enables the creation of MS Word and PDF documents from within a workflow process. When this activity is executed within a workflow, it uses a selected template and creates a new document with the relevant data in a specified location. The source files can leverage Office Documents saved as XML format. Source files may be edited with replacement values to be set, for example with a suitable syntax, “[MYREPLACEMENT]”. The replacement syntax can be of any usable desired format. The replacement values will be set with values then defined within the “Replacement Values” property.
Action Outputs:
Failure – The action failed to generate the document
Success – The document was created
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Template File Path (Required)
The source file location for the template
Output File Path (Required)
The target file location for the newly created document
Replacement Values
The list of replacement keys and values to set
Error Message
A variable to set messages for any errors encountered.
File Type to Generate
The file type that should be generated with this action
# Create File
Action Function: The File Create activity will create a new file at a specified file path.
Action Outputs:
Failure – There was an error in the attempt to create the file
Success – The file was created
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information. If blank, or “system”, the action will run in the workflow engine context.
File Path (Required)
This property specifies the full local or UNC path where the file should be created.
File Data (Required)
This property specifies the body of the file.
Error Message
A variable to set messages for any errors encountered.
# Delete Directory
Action Function: The Directory Delete activity enables the removal of a directory at a specified location.
Action Outputs:
Failure – The action failed to delete the directory
Success – The directory was deleted
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Directory Path (Required)
This property specifies the full local or UNC of the directory to be deleted.
Error Message
A variable to set messages for any errors encountered.
# Delete File
Action Function: The File Delete activity will delete a file at a specified file path.
Action Outputs:
Failure – There was an error in the attempt to delete the file
Success – The file was deleted
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
File Path (Required)
This property specifies the full local or UNC path of the file that should be deleted.
Error Message
A variable to set messages for any errors encountered.
# Directory Exists
Action Function: The Directory Exists activity will check for the existence of a directory at a specified location.
Action Outputs:
Exists – The directory was found
Does Not Exist – The directory was not found
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Directory Path (Required)
This property specifies the full local or UNC path of the directory.
Error Message
A variable to set messages for any errors encountered.
# Directory Info
Action Function: The Directory Exists activity will check for the existence of a directory at a specified location.
Action Outputs:
Exists – The directory was found
Does Not Exist – The directory was not found
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Directory Path (Required)
This property specifies the full local or UNC of the directory.
Directory Info
This property specifies the variable to store the details about the directory including created date, modified date and full path.
Error Message
A variable to set messages for any errors encountered.
# File Exists
Action Function: The File Exists activity will check for the existence of a file at a specified location.
Action Outputs:
Exists – The file was found
Does Not Exist – The file was not found
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
File Path (Required)
This property specifies the full local or UNC path of the file.
Error Message
A variable to set messages for any errors encountered.
# Find File
Action Function: The File Exists activity will check for the existence of a file at a specified location.
Action Outputs:
Failure – There was an error in the search (e.g. the path did not exist)
Success – The search was successful
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Directory Path (Required)
This property specifies the full local or UNC path to search.
Search String (Required)
This property specifies the partial/full name of the file, as well the extension. The ‘*’ character is a supported wild card and if used will return all files in the given path.
Recursion (Required)
Yes/No option, where Yes will allow the search to look at all sub folders, and No will only return results in the specific file path.
Search Result (Required)
This is a text string of the files found in an XML data structure. It will include the number of files found, and for each file it will return created date, last modified date, name, directory path, full path, and length in bytes.
Error Message
A variable to set messages for any errors encountered.
# Insert File into DB
Action Function: The File Insert to DB activity will write a file to a specified database location.
Action Outputs:
Failure – There was an error in writing the file
Success – The file was successfully written to the database
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
File Path
This property specifies the full local or UNC path where the file to write to the database is stored.
Registered Datasource
The property specifies the name of the desired data source. The data source must be registered via Administration > External Datasources.
Document Table Name
This property specifies the table name in which the document should be stored.
Variable for Output Message
A variable to set messages for any errors encountered.
# Move File
Action Function: The File Move activity will move a file from one location to another.
Action Outputs:
Failure – There was an error in moving the file
Success – The file was successfully moved to the destination
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
Source Path
This property specifies the full local or UNC path of the source file to be moved.
Destination Path
This property specifies the full local or UNC path the source file should be moved to.
Overwrite
This property specifies whether or not a file should be overwritten if one is found in the destination path with the same name.
Error Message
A variable to set messages for any errors encountered.
# Read File
Action Function: The File Read activity will save the contents of a file to a variable.
Action Outputs:
Failure – There was an error in the attempt of opening or reading the contents of the file.
Success – The file was successfully found, opened, and saved to the specified variable.
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Scenario
Specifies the scenario name to use for impersonation. See FileIO.Config.xml for more information.
File Path
This property specifies the full local or UNC path to read.
File Data
The property specifies the variable to store the body of the file.
Error Message
A variable to set messages for any errors encountered.
# Zip File
Action Function: The Zip File action will create a zip file from the Source File Variable and set the Target File Variable with the resulting zip file.
Action Outputs:
Failure – The file wasn’t successfully zipped, the Target File Variable wasn’t set, and/or a required value was missing.
Success – The file was successfully zipped and the Target File Variable was set.
Action Properties:
Label
This property designates the name of the action or step as shown within the workflow design.
Properties
Source File Variable
A file variable containing the file to zip.
Target Filename
The name of the resulting file. Include the .zip extension or no extension.
Target File Variable
A file variable which will contain the zipped file result.
Error Message Variable
A variable to set messages for any errors encountered.
← OLA and SLA REST →