clsStoreFileInDB step

Use this step to store/replace a file in deFileStore table

Last published at: March 24th, 2025

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
  • Define a variable/global to store the File ID
  • Click the “storeFileInDB” step to configure its “Required” 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.  

 

  • Click the “storeFileInDB” step to configure its “Optional” properties. Select Yes to remove the file using its File ID on the path provided. Provide the existing File ID. 

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new 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 new 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.

 

Definition Sample:

You may download the ZIP file and extract the sample definition(s) from the link here. Then, you can later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.

Click here to download the sample file.

 

 

 

How can we improve this article?

Share additional info and suggestions