clsstorefileindb step

Last published at: May 14th, 2024

Description:

Store the file as a record (or Replace the file) in deFileStore table in FlowWright database 

Delete

Inputs

  • pathToFile – File name with actual server path (eg.C:\inetpub\wwwroot\cDevWorkflow\DocReport\output\12345.pdf  OR equivaluent variable.Path reference) 
  • removeFile – Remove file (Yes / No). Configure YES to remove the original file from the file system referred in the actual path; after storing in deFileStore table. 
  • existingFileID – Provide existing File ID to replace with new File ID  
  • varGlobalToStoreID – Variable / Global to store File ID 
Delete

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 properties as shown on the below graphic 

  • Provide the file name with actual server file path OR variable name with equivalent value
  • Provide the variable/global to store the File ID 
  • 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 reference. Navigate to Process Instances, render this process instance, click on storeFileInDB step and view varGlobalToStoreID.

  • To Replace the file in deFileStore table, click on the “storeFileInDB” step to configure its properties as shown on the below graphic.
  • "The path to the file" input is the server path for the new file or its variable.value. Provide the existing file in storeFileInDB table by its FileID. In this case, the Variable/Global to store the replaced FileID shall be the same variable.value, as shown above. 
  • Save the process definition, create a process instance and execute.  The step replaces the file as a in the deFileStore table using the FileID as reference. Navigate to Process Instances, render this process instance, click on storeFileInDB step and view varGlobalToStoreID.