Load All Files
  • 19 Jan 2023
  • 2 Minutes to read
  • Dark
    Light

Load All Files

  • Dark
    Light

Article summary

Step Details

Introduced in Version4.0.0
Last Modified in Version7.12.0
LocationFile Management

The Load All Files step uses the path to a directory and will output a list of all files found in this directory and any nested directories. The step will not indicate the location the file was pulled from. If the full path to the directory is not entered, the step will begin searching from the C:\Program Files\Decisions\Decisions Server for the directory.



Properties

Inputs

PropertyDescriptionData Type
DirectoryThe full path to the directory.String

Outputs

PropertyDescriptionData Type
OutputThe contents of the files loaded as a FileData type. Any file from the directory or subdirectory will be included in the output.List of FileData

Example Inputs and Outputs

DirectoryOutput
C:\ExamplesList of all files found in C:\Examples
C:\examplesList of all files found in C:\Examples
NullException Message
Empty StringException Message
ExamplesList of all files found in C:\Program Files\Decisions\Decisions Server\Examples



Common Errors

Path is empty

If the path specified for the Directory input is null or empty, the step will throw the following error. Ensure that the Directory input contains a valid string and is not null.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Load All Files[LoadAllFiles] in flow [Testing]: Exception invoking method LoadAllFiles on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method LoadAllFiles on class FileSteps ---> System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.ListFilesInDirectoryByExtension(String directoryName, String ext)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadAllFilesWithExtension(String directory, String extension)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadAllFiles(String directory) 
   --- End of inner exception stack trace ---
   at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data)
   at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData)
   at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) 
   --- End of inner exception stack trace ---


Could not find part of a path

If the Directory input is misspelled or incorrect, the following error will be thrown. Ensure that the input is correct.

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Load All Files[LoadAllFiles] in flow [Testing]: Exception invoking method LoadAllFiles on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method LoadAllFiles on class FileSteps ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Decisions\Decisions Server\example'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.ListFilesInDirectoryByExtension(String directoryName, String ext)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadAllFilesWithExtension(String directory, String extension)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadAllFiles(String directory) 
   --- End of inner exception stack trace ---
   at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data)
   at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData)
   at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) 
   --- End of inner exception stack trace ---

Related Information

Example Labs:

Forum Posts:


Was this article helpful?