Using Process Folders
  • 14 May 2021
  • 8 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Using Process Folders

  • Dark
    Light

Article summary

Saving a Comment to a Process Folder

Process Folders are one of the core functions of maintaining audit trails for state-driven processes. What makes them so useful is they keep track of the folder's state, and any user comments within them. This document will cover the avenues of adding comments to Process Folders. Users can add a comment to a newly created Process Folder in a Flow, or retrieve a pre-existing Process Folder and add a comment to that record. 

There are two Add Comment steps that will be demonstrated:

  • Add Comment, located in the Flow Management > Data category, or it can be searched for in the Steps catalog. 
  • Add Comment, located in Integration > Internal Services > Comment.

The Add Comment step located in Flow Management section is used for adding comments to newly created Process Folders. It only has 2 inputs, one for the Name of the Comment which is the comment's title, and another one is for the input for the Comment itself. The Add Comment step located in Internal Services also has two input variables: entityid and comment. This step can be used to add a comment to a new Process Folder, or one that already exists.

Process Category Add Comment Example

  1. To begin, navigate to a Designer Folder, right-click and locate Add > Folder. 
  2. Name the Folder [Process Folder Data], and then click SAVE.
  3. In the Designer Folder, select CREATE FLOW from the bottom action panel.
  4. In the Create Flow window, select and name the default Flow [Saving a Comment to a Process Folder]. Click CREATE.
  5. In the Flow Designer, drag over a Setup Process Folder step and the Add Comment step located in the Flow Management > Data category.
    Note: This Add Comment step is meant to be used after the Setup Process Folder step. The Add Comment step must be used in tandem with the Setup Process Folder step.
  6. On the Setup Process Folder step, configure the Properties panel > Parent Folder > Parent Folder with a Constant input mapping. Pick the Folder [Process Folder Data] created in earlier steps.
  7. Declare Constant input mappings for Inputs > Folder Description and Folder Name. Uniquely name both.
  8. On the Add Comment step, configure the Inputs > Comment and Name with Constant input mappings and type text in those fields.
  9. Finally, select Debug from the top Action bar to create a record in the Folder [Process Folder Data].
  10. Navigate to the Folder [Process Folder Data] and click on the newly created Process Folder.
  11. In the Process View page, the newly created Comment will be displayed.

Internal Services Add Comment Step Example

This example will use the Add Comment step from the Integration > Internal Services > Comment category to add another Comment to the previously created Process Folder.

  1. Navigate back to the Designer View in a Designer Folder and select CREATE FLOW from the bottom Action panel.
  2. Select and name the default Flow [Internal Services Add Comment Example]. Click CREATE.
  3. In the Flow Designer, navigate to Integration > Internal Services > Comment section and drag and drop an AddComment step to the workspace. 
  4. Add a Fetch Entities step to the workspace from the Steps > Favorite Steps section.
  5. On the Fetch Entities step, configure Entity Fetch Definition > Type Name to be set to the Folder data type. 
  6. Set the Parent Folder Id to a Constant input mapping and pick the Folder[Process Folder Data].
  7. On the Add Comment step configure the entityid to a Select From Flow input mapping.
  8. Map in the variable with the outcome of the Fetch Entities step, then drill down to First, then FolderID.
  9.  For the comment input, set it to a Build Data input mapping; this will allow users to have access to the properties that comprise the Comment data type.
  10. The Comment Name is the data member which stores the title of the comment. The Comment Description, stores the comment text. Declare unique and Constant String values for these inputs.
  11. Debug the Flow to have the comment created and applied to the Process Folder.
  12. Finally, navigate back to the Process Folder Data and click on the Process Folder.
  13. In the Process View Page, the second Comment can be found underneath the first Comment.

Saving a Document to a Process Folder

Process Folders can have documents stored within them. The following section will demonstrate how to configure a Flow to store a document in a Process Folder.

  1. Begin by creating a Normal Folder [ProcessFolderData].
  2. Next, select CREATE FLOW from the bottom Action panel. 
  3. Select and name the default Flow [Saving a Document to the Process Folder]. Click CREATE.
  4. Within the Flow Designer, configure the Start step to expect a variable from the type FileData.
  5. From the Steps > Flow Management > Data and drag the Setup Process Folder step into the workspace.
  6. From the same location, drag an Add File step to the Flow and place it after the Setup Process Folder step.
  7. On the Setup Process Folder step, set the Parent Folder > Parent Folder to the Normal Folder [ProcessFolderData] configured earlier.
  8. Configure a Constant input mapping and unique names for the Inputs > Folder Description and Folder Name.
  9. On the Add File step, with a Select From Flow mapping, select the InputFile, then drill down to Contents on the Input > Data value field.
  10. Next, set the Inputs > Name to a Constant input mapping, and input a relevant file name.
  11. Debug the Flow and add a test file to create the record in the Process Folder and store the file.
  12. Navigate to the Folder [ProcessFolderData] and select the newly created Folder.
    The file should be found in that folder on the Folder Activity Panel and in the Document Header. Depending on the file type there will be actions to Download, Update and View the file.

Retrieving A File From A Folder Dynamically

Files stored in Folders can also be retrieved by Flows. Follow these steps to create a Flow to that retrieves files from a folder.

Prerequisites 
Before proceeding with this example:
Navigate to the Process Folder and obtain its Folder Id by locating it in the Decisions Studio, right-clicking it and selecting Manage > Get FolderID. Then copy the Folder ID.


  1. From a Designer Project, select CREATE FLOW and CREATE a new Flow.
  2. From the Flow Designer, navigate to the Integration > Internal Services > DocumenttService category in the Steps tab, and attach a GetByFolderID step to the Start step.
  3. From the Properties tab of the Get By Folder ID step, Constant map the folder ID of the Process Folder to its respective Input under INPUTS. 
  4. From Steps > Favorite Steps, attach a Create Data step to the Done path of the Get By Folder ID step.
  5. Navigate to the Properties for the Create Data step; under DATA > Data to Create, click Show Editor
  6. From Data Definitions, provide a Name, select File Data from the Type dropdown, and check the Is List box. Then, set the Input to Constant, and CLOSE out both windows. 
  7. Back in the Flow Designer, connect a ForEach Step, from Steps > Flow Managementto the outcome path of the Create Data step. 
  8. From the ForEach Step's Properties, map GetByFolderID1_Output.All DocumentID to Collection. Then, connect the Done path to the End step. 
    Note on Data > Type 
    Note that mapping Input to Collection will automatically change the Type in the DATA > Type dropdown.

  9. From the same DocumentService category as the Get By Folder ID step, attach a GetDocumentData step to the Next path of the ForEach Step. From the Properties tab of the newly added step, map Item to INPUTS > document ID

    Note on Get Document Data
    This step is used to retrieve the FileData for the designated Document. 

  10. Under Steps > Data > List, attach an Add Item to List Step to the Get Document Data step. Map GetDocumentData1_Output to New Item and the Output from the Create Data step to Original List. Then, connect the Done path to the ForEach Step.

  11. Select the End step; under Properties > Data > Pick From Current Data, select New List

  12.  Save the Flow, then if desired, close the Flow via X.

  13. From the Flow Designer, select the Debug link then click Run Capturing All

  14. After the Flow runs, select the End step, then click View Execution 1 > View Output Data

    Results 
    The resulting Output Data represents a list of the Files contained within the Process Folder. 


    Setting a Process's State and State Reason

    Process Folders can be assigned a State and State Reason by using the Set State Reason or the Set State And Reason steps. It can be found in the Steps > Flow Management > Data category. This Flow step merely writes the user-defined Reason as a string value in the extension data of the Process Folder. By default, it is not displayed on a Process Folder when it is created. The reason value can be displayed in the Report Designer by displaying the State Reason data member when reporting on the FlowTrackingFolderData data source.

    Note:
    The Set State and Reason step must be used in tandem with the Setup Process Folder step.
    1. To set a Reason on a Process Folder, configure a Flow that contains both a Setup Process Folder and a Set State and Reason step after it. 
    2. With the Setup Process Folder step selected, specify the Parent Folder > Parent Folder value as the Folder created earlier in the document. 
    3. Set the Inputs > Folder Description and Folder Name to Constant inputs and enter unique values.
    4. Next, configure the Inputs >State and State Reason as Constant input mapping and give unique values.
    5. After Debugging the Flow, a Process Folder will be created.
      It stores the 'State Reason' value in the FlowTrackingFolderData data source. This allows users to be able to report on it. 
    6. To view the State Reason, create a Report that is sourced from FlowTrackingFolderData
    7. Pick the State Reason Data Field.

    Set State Color

    A Folder's state color can be changed by utilizing the Set State Color step. This changes the color of the state on the Process View Page's Folder Activity Panel. This step also needs to be used in tandem with the Setup Process Folder step.

    1. Begin in a Designer Folder and select CREATE FLOW from the bottom action panel. Select and name the default Flow [Set State Color].
    2. From the Flow Designer, drag the Setup Process Folder, Set State, and the Set State Color steps to the workspace; these steps can be found in the Flow Management > Data category of the Steps catalog. 
    3. Configure the Setup Process Folder step with a Parent Folder > Parent Folder >Folder data type. Select the Folder created at the beginning of the document.
      1. Change the Inputs > Folder Description and Folder Name to a Constant input mapping and give unique values.
    4. Configure the Set State step to a Constant input mapping and make a note of that Inputs > State value.
    5. On the Set State Color step, set the Inputs > Color input to Constant and select the desired color.
    6. On the Inputs > State, set it to a Constant input mapping and make sure it matches the State value configured on the Set State step.
    7. Debug the Flow to create a Process Folder and navigate to the user-defined location for Process Folders. 

Was this article helpful?