clsInstantiateFromFile Step

Use this step to instantiate process instance from a file

Last published at: September 16th, 2024

Description:

This step instantiates a process instance for every single row of the Excel data file.

 

Inputs

  • filePath--Path to csv or xls file
  • passGlobals—Pass Globals to Instance
  • passVariables—Pass Variables to Instance
  • colMappings--Column mappings      
  • firstRowHeadings--First row has headings
  • definitionID--Select definition
  • executionPriority - Select execution priority
 

   

Returns

  • True – step executed successfully
  • False - step failed to execute
 

 

Usage:

 

 

Example:

Let’s build and execute the “clsInstantiateFromFileDef” example.        

  • Create a new definition called “clsInstantiateFromFileDef”
  • Select the definition and click the “design” button
  • Drag a "clsInstantiateFromFile" step to the canvas
  • Connect the dots between the start and "clsInstantiateFromFile" step
  • Click the "clsInstantiateFromFile" step to configure its "Settings" properties. Provide a name for the step. Provide the path to the CSV or XLS file containing a few row items to instantiate the process by # of times. Click on the button to complete the column mappings. Select the process definition from the drop-down list to instantiate. 

 

  • The content of the Excel file is included here for reference. 

 

  • Click on the button to complete the column mappings. Provide the process variable/global reference and mention the column position in the CSV or XLS file to map. The column indexes are identified from left to right by  

 

  • Click on the "clsInstantiateFromFile" step to configure its "Advanced" properties. Select YES to identify the first row of the file as headings. Select YES if the workflow is passing variables or globals to the instance. Select the execution priority in the drop-down list. 

 

  • 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 process instance, and execute. Using the configured process definition, the process step should instantiate a new instance for each row in the CSV or XLS file.

 

Definition Sample:

You may download the sample definition from the link here and later import it (drag-drop) to your FlowWright Process (XML) and Form Definition (HTML) page. After import, you must verify the process steps and complete the database configuration, if any. 

 

https://github.com/FlowWrightCode/FW10Steps/blob/main/InstantiateFromFileDef-Data.xlsx 

https://github.com/FlowWrightCode/FW10Steps/blob/main/FW-Fillable-PDF-Form.pdf 

https://github.com/FlowWrightCode/FW10Steps/blob/main/FW-Fillable-PDF-Form.xml 

https://github.com/FlowWrightCode/FW10Steps/blob/main/clsInstantiateFromFileDef.xml