Description:
This step stores the file as a record (or Replaces the file) in the deFileStore table in the FlowWright database.
Inputs
- pathToFile – File name with actual server path (e.g., C:\inetpub\wwwroot\cDevWorkflow\DocReport\output\12345.pdf or equivalent variable.Path reference)
- removeFile – Remove file (Yes / No). Configure YES to remove the original file from the file system referred to in the actual path after storing it in the deFileStore table.
- existingFileID – Provide existing File ID to replace with new File ID
- varGlobalToStoreID – Variable / Global to store File ID
Returns
- True – step executed successfully
- False - step failed to execute
Usage:
Example:
Let’s build and execute the storeFileInDBDef example:
- Create a new definition called “storeFileInDBDef.”
- Select the definition and click the “design” button
- Drag a “storeFileInDB” step to the canvas
- Connect the dots between the start and storeFileInDB step
- Click on the “storeFileInDB” step to configure its “Settings” properties. Provide a name to the step. Provide the source file path information. Provide a variable/global reference to store the File ID. Click the Save button to confirm.
- Save the process definition, create a process instance, and execute. The step stores the file as a new record in the deFileStore table and provides FileID as a reference. Navigate to Process Instances, render this process instance, click on the storeFileInDB step, and view varGlobalToStoreID.
- To Replace the file in the deFileStore table, click on the “storeFileInDB” step to configure its “Settings” properties. Provide the step name. Provide the source file path information. Provide the variable/global reference to store the File ID. Click the Save button to confirm.
- To Replace the file in the deFileStore table, click on the “storeFileInDB” step to configure its “Advanced” properties. Select the Yes button to replace. The path to the file" input is the server path for the new file or its variable.value. Provide the existing file in the storeFileInDB table using its FileID. In this case, the Variable/Global to store the replaced FileID shall be the same variable.value, as shown below.
- Save the process definition, create a process instance, and execute. The step replaces the file in the deFileStore table using the FileID as a reference. Navigate to Process Instances, render this process instance, click on the storeFileInDB step, and view varGlobalToStoreID.