Load File
  • 19 Jan 2023
  • 2 Minutes to read
  • Dark
    Light

Load File

  • Dark
    Light

Article Summary

Step Details

Introduced in Version3.0.0
Last Modified in Version8.0.0
LocationFile Management

The Load File step accesses a file based on a specified file path. By default, the step will load files stored locally but can be used to load files on a network share, provided that the service account used by Decisions has access to the share.


Properties

Inputs

PropertyDescriptionData Type
File NameThe name including the full path to the file. If only the file name is used, the file must be placed in the file storage location.String

Outputs

PropertyDescriptionData Type
OutputThe contents of the file loaded as a FileData type.FileData

Example Inputs and Outputs

InputOutput
C:\Examples\example.txtOutputs a FileData object representing the example.txt file.
C:\Examples\exampleOutputs a FileData object representing the example file.
example.txtOutputs a FileData object of a file found at C:\Program Files\Decisions\Decisions Server
Null valueEXCEPTION MESSAGE
Empty StringEXCEPTION MESSAGE


Common Errors

Null value passed as input to the step

If a Null or empty string is passed as an input to the step, the following error will be thrown. Ensure the input is a valid string and contains the path to the file.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Load File 1[LoadFile] in flow [Testing]: Exception invoking method LoadFile on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method LoadFile 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) 
   --- 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 ---


File not found

If the file cannot be found, confirm if  the full file path and file extension are included as an input.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Load File 1[LoadFile] in flow [Testing]: Exception invoking method LoadFile on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method LoadFile on class FileSteps ---> System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Decisions\Decisions Server\example'. File name: 'C:\Program Files\Decisions\Decisions Server\example'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.File.ReadAllBytes(String path)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.LoadFile(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?

What's Next