Load and Delete File
  • 20 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Load and Delete File

  • Dark
    Light

Article Summary

Step Details

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

The Load and Delete File step loads a file during runtime and removes the file locally. The full path to the file must be provided as input. Once the step completes, the file will be deleted from the file storage and exist only in memory. If only the file name is provided as an input, the step will limit searching for the file in the Decisions 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

InputOutput
example.txtOutputs a fileData object representing the file
C:World
Null ValueEXCEPTION MESSAGE
Empty StringEXCEPTION MESSAGE



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 And Delete File 1[LoadAndDeleteFile] in flow [Testing]: Exception invoking method LoadAndDeleteFile on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method LoadAndDeleteFile on class FileSteps ---> System.ArgumentNullException: Path cannot be null. (Parameter 'path')
   at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.ReadAllBytes(String path)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadFile(String fileName)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadAndDeleteFile(String fileName) 
   --- 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?