Load File
- 19 Jan 2023
- 2 Minutes to read
- Print
- DarkLight
Load File
- Updated on 19 Jan 2023
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Step Details | |
Introduced in Version | 3.0.0 |
Last Modified in Version | 8.0.0 |
Location | File 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
Property | Description | Data Type |
---|---|---|
File Name | The 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
Property | Description | Data Type |
---|---|---|
Output | The contents of the file loaded as a FileData type. | FileData |
Example Inputs and Outputs
Input | Output |
---|---|
C:\Examples\example.txt | Outputs a FileData object representing the example.txt file. |
C:\Examples\example | Outputs a FileData object representing the example file. |
example.txt | Outputs a FileData object of a file found at C:\Program Files\Decisions\Decisions Server |
Null value | EXCEPTION MESSAGE |
Empty String | EXCEPTION 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?