FilePlugin

— File Processing Plugin

Table of contents

  1. Actions
    1. FileRead
    2. FileWrite
    3. FileDelete
    4. FileMove
    5. FileCopy
    6. FileRename
    7. FilesListRead
    8. FilesListDelete
    9. FilesListMove
    10. FilesListCopy
    11. FilesListRename
    12. DirectoryCreate
    13. DirectoryDelete
    14. DirectoryMove
    15. DirectoryCopy
    16. DirectoryRename
    17. DirectoryGetFiles
    18. DirectoryGetDirectories
    19. DirectoryCompress
    20. FilesCompress
    21. FileUncompress
  2. Conditions
    1. FileExists
    2. FilesListExists
    3. DirectoryExists
  3. Elements
    1. ParameterPurpose
    2. ParameterType
    3. Masks
    4. ArchiveType

Actions

FileRead

Table of contents

— Reading Data from a File.

Parameters:

  • Path - the path to the file.
  • Parameter name - the name of the parameter intended to get the file contents.
  • Parameter purpose - read about parameter purpose.
  • Parameter type - read about parameter type.
  • File mode - read about file mode.
  • File access - read about file access.
  • File share - read about file share.
  • Buffer size - the buffer size for data reading; set as a positive integer; the default buffer size is 4096.

FileWrite

Table of contents

— Writing Data to a File

Parameters:

  • Path - the path to the file.
  • Text - the text to be written.
  • File mode - read about file mode.
  • File access - read about file access.
  • File share - read about file share.

FileDelete

Table of contents

— Deleting a File.

Parameters:

  • Path - the path to the file.

FileMove

Table of contents

— Moving a File.

Parameters:

  • Path - the path to the file.

  • Path for move - the new path to the file.

FileCopy

Table of contents

— Coping a File.

Parameters:

  • Path - the path to the file.

  • Path for copy - the path to the file copy.

FileRename

Table of contents

— Renaming a File.

Parameters:

  • Path - the path to the file.

  • New path - the path to the file with the new name.

FilesListRead

Table of contents

— Reading a List of Files.

Parameters:

  • Files list read - the list of files to be copied to the parameters specified.

    Example: file path 1 => parameter name 1; file path 2, file path 3, file path 4 => parameter name 2

    The contents of «file path 1» will be copied to the parameter specified as «parameter name 1»

    The contents of «file path 2», «file path 3», and «file path 4» will be copied to the parameter specified as «parameter name 2»

    The data is written to the parameter as a dictionary:

    //synchronous work with the parameter
      var data1 = processInstance.GetParameter<Dictionary<string, string>("parameter name 1");
    
    //asynchronous work with the parameter
    var data2 = await processInstance.GetParameterAsync<Dictionary<string, string>("parameter name 2").ConfigureAwait(false);
  • Parameter purpose - read about parameter purpose.

  • Identify by full name - the flag to set the path:

    • true - the dictionary key is the full file name and the path to it
    • false - the dictionary key is the filename only, without extension

    Adding files with the same name to the dictionary throws an exception.

  • Parameter type - read about parameter type.

  • List files mode - read about file mode.

  • List files access - read about file access.

  • List files share - read about file share.

  • Buffer size - the buffer size for data reading; set as a positive integer; the default buffer size is 4096.

FilesListDelete

Table of contents

— Deleting a List of Files.

Parameters:

  • Files list delete - the list of the paths of the files to be deleted, separated by commas.

    Example: file path 1, file path 2

    The files with «file path 1» and «file path 2» will be deleted.

FilesListMove

Table of contents

— Moving a List of Files.

Parameters:

  • Files list move - the list of the current paths and new paths Example: file path 1 => path for move 1, file path 2 => path for move 2

    The file with «file path 1» will be moved to «path for move 1», The file with «file path 2» will be moved to «path for move 2».

FilesListCopy

Table of contents

— Copying a List of Files.

Parameters:

  • Files list copy - the list of the current paths and the new paths for copying.

Example: file path 1 => path for copy 1, filePath2 => path for copy 2.

The file with «file path 1» will be copyied at «path for copy 1», The file «file path 2» will be copyied at «path for copy 2».

FilesListRename

Table of contents

— Renaming a List of Files.

Parameters:

  • Files list rename - the list of the current paths adn the new paths with the new names.

Example: file path 1 => file new path 1, file path 2 => file new path 2.

The file with «file path 1» will be renamed and moved to «file new path», The fie with «file path 2» will be renamed and moved to «file new path 2».

DirectoryCreate

Table of contents

— Creating a Directory.

Parameters:

  • Path - the folder path to be created.

DirectoryDelete

Table of contents

— Deleting a Directory.

Parameters:

  • Path - the folder path to be deleted.

  • With files and sub directory - the flag to delete subfolders and files:

    • true - the folder will be deleted with its subfolders and files.
    • false - if the folder contains any subfolders or files, it will not be deleted.

DirectoryMove

Table of contents

— Moving a Directory.

Parameters:

  • Path - the folder path to be moved.
  • New path - the new folder path.

DirectoryCopy

Table of contents

— Copying a Directory.

Parameters:

  • Path - the folder path to be copied.

  • Copy path - the new folder path.

  • Sub directory - the flag to copy subfolders:

    • true - the subfolders will also be copied.
    • false - the subfolders will not be copied.
  • Mask sub directories - the mask for subfolders. Only the subfolders matching this mask will be copied. Read about masks.

  • Mask files - the mask for files. Only the files matching this mask will be copied. Read about masks.

DirectoryRename

Table of contents

— Renaming a Directory.

Parameters:

  • Path - the folder path.
  • New path - the folder path with the new name.

DirectoryGetFiles

Table of contents

— Getting a List of Files in Directory.

Parameters:

  • Directory get files - the list of the directories whose files to be listed into the parameters specified.

    Example: path 1 => parameter name 1; path 2, path 3, path 4 => parameter name 2.

    The files from the folder «path 1» will be added to the parameter specified as «parameter name 1».

    The files from the folders «path 2», «path 3», and «path 4» will be added to the parameter specified as «parameter name 2».

    The data is written to the parameter as a dictionary:

    //synchronous work with the parameter
      var data1 = processInstance.GetParameter<Dictionary<string, string>("parameter name 1");
    
    //asynchronous work with the parameter
    var data2 = await processInstance.GetParameterAsync<Dictionary<string, string>("parameter name 2").ConfigureAwait(false);
  • Parameter purpose - read about parameter purpose.

  • Identify by full name - the flag to set the path:

    • true - the dictionary key is the full file name and the path to it
    • false - the dictionary key is the filename only, without extension

    Adding files with the same name to the dictionary throws an exception.

  • Sub directory - the flag to copy subfolders:

    • true - the subfolders will also be copied.
    • false - the subfolders will not be copied.
  • Mask sub directories - the mask for subfolders. Only the subfolders matching this mask will be copied. Read about masks.

  • Mask files - the mask for files. Only the files matching this mask will be copied. Read about masks.

DirectoryGetDirectories

Table of contents

— Getting a List of Subdirectories in Directory.

Parameters:

  • Directory get directories - the list of the directories whose subdirectories to be listed into the parameters specified.

    Example: path 1 => parameter name 1; path 2, path 3, path 4 => parameter name 2.

    The subdirectories of the folder with «path 1» will be added to the parameter specified as «parameter name 1».

    The subdirectories of the folders with «path 2», «path 3», «path 4» will be added to the parameter specified as «parameter name 2».

    The data is written to the parameter as a dictionary:

    //synchronous work with the parameter
      var data1 = processInstance.GetParameter<Dictionary<string, string>("parameter name 1");
    
    //asynchronous work with the parameter
    var data2 = await processInstance.GetParameterAsync<Dictionary<string, string>("parameter name 2").ConfigureAwait(false);
  • Parameter purpose - read about parameter purpose.

  • Identify by full name - the flag to set the path:

    • true - the dictionary key is the full file name and the path to it
    • false - the dictionary key is the filename only, without extension

    Adding files with the same name to the dictionary throws an exception.

  • Sub directory - the flag to copy subfolders:

    • true - the subfolders will also be copied.
    • false - the subfolders will not be copied.
  • Mask sub directories - the mask for subfolders. Only the subfolders matching this mask will be copied. Read about masks.

DirectoryCompress

Table of contents

— Compressing a Directory.

Parameters:

  • Archive path - the path to the archive.

  • Directory path - the folder path to be compressed.

  • Sub directory - the flag to copy subfolders:

    • true - the subfolders will also be copied.
    • false - the subfolders will not be copied.
  • Mask sub directories - the mask for subfolders. Only the subfolders matching this mask will be copied. Read about masks.

  • Mask files - the mask for files. Only the files matching this mask will be copied. Read about masks.

  • Archive type - the archive type. Read about archive type.

FilesCompress

Table of contents

— Compressing a List of Files.

Parameters:

  • Archive path - the path to the archive.
  • Files paths - the file paths to be added to the archive.

Example: file path 1, file path 2.

The archive containing the files with «file path 1» and «file path 2» will be created.

  • Mask files - the mask for subfolders. Only the subfolders matching this mask will be copied. Read about masks.
  • Archive type - the archive type. Read about archive type.

FileUncompress

Table of contents

— Uncompressing.

Parameters:

  • Archive - the path to the archive.
  • Directory path - the path to the uncompressed contents.
  • Archive type - the archive type. Read about archive type.

Conditions

FileExists

Table of contents

— Checks if a File Exists.

Parameters:

  • Path - the path to the file.

FilesListExists

Table of contents

— Checks if a List of Files Exists.

Parameters:

  • Files list exists - the list of the file paths to be checked for existence.

Example: file path 1, file path 2.

The files with «file path 1» and «file path 2» will be checked for existense.

  • Concatenation - the way to combine the results. Read about concatenation.

DirectoryExists

Table of contents

— Checks if a Folder Exists.

Parameters:

  • Path - the path to the folder.

Elements

ParameterPurpose

Table of contents

— File Purpose.

  • Temporary

Temporary Parameter exists from the time of its conveying to a process, or its setting within a process, till the end of the transition process. In other words, if you convey Parameter with Purpose = Temporary to the process through Command, it will be possible to obtain its Value only until the process stops and begins waiting for another Command.

  • Purpose

Persistence Parameter is stored in a database in the WorkflowProcessInstancePersistence table (or object). Its Value may be accessed at any time after it has been set. The third type of Purpose is a system one.

  • System

System Parameters cannot be created; they are used by Workflow Engine for its proper operation. You may access them trough the ProcessInstance object. These Parameters will be discussed in detail further on.

ParameterType

Table of contents

— File Data Type to Be Read.

  • String

The data will be saved as a string. Use this type when working with a text file.

  • Byte

The data will be saved as a Byte array. Use this type when working with a non-text file.

Masks

Table of contents

— Mask to Search for Files and Folders.

Parameters

Table of contents

File masks can consist of any combination of the following elements:

  • Fixed characters

Letters, numbers and other characters allowed in file names.

  • Question mark (?)

Represents any single character.

  • Asterisk (*)

Represents any sequence of characters (including no characters at all).

Examples

Table of contents

File Mask Description & Examples
* Matches all files containing any amount of characters, with or without extensions (e.g., entering A* would match any file or folder starting with the letter A followed by any amount of characters).
*.* Matches all files containing any amount of characters and with any extension. Even matches files that don't have an extension (e.g., entering A*.* would match any file starting with the letter A followed by any amount of characters along with any extension).
? Matches any single character (e.g., entering A? would match any file starting with the letter A followed by any single character).
*.png Matches all files with names containing any amount of characters with a .png extension (e.g., image_name.png, cool_pic.png, 1.png).
*.p* Matches all files with names containing any amount of characters with an extension starting with the letter p (e.g., document.pdf, image_name.png, business.project, 1.ppt)
pic*.* Matches all files with names that start with pic (e.g., picture_name.png, pictogram.ico, picker.html, pic).
*mat?.html Matches all .html files with names starting with any sequence of characters, followed by the string mat, and ending with a single character (e.g., automate.html, mate.html, tomato.html).
?????? Matches all files with names containing six characters and without an extension (e.g., 123456, myFile, my_pic, images)
doc?????.pdf Matches all .pdf files with names that start with doc followed by any five characters (e.g., document.pdf, doctrine.pdf, doc_1234.pdf).
file1.txt|file2.jpg|file3.png Matches specific filenames or wildcard masks that reside in the same directory (e.g., c:\temp\file1.txt
c:\temp1*.txt c:\temp2*.png

ArchiveType

Table of contents

  • ZIP

The most common compression file format used in Windows operating systems.

  • TarGZ

The most common compression file format used in Linux and Mac OS operating systems.

Concatenation

Table of contents

  • And

concatenation with the conjunction operation.

  • Or

concatenation with the disjunction operation.

Table of contents

Top