Setting a Process’s State and State Reason

Last Updated: 07/06/2018 Introduced in Version: 2.0

Process folders can be assigned a state and state reason by using the Set State and State Reason component. It can be found in the Toolbox tab, under the category Flow Management > Data.

Example

In this example flow, we will set up a process folder to hold data for a Customer’s financing application. This example assumes that our flow’s forms have already been designed. At each stage of the application process, the process’s state will change, from Started to Submitted, and then to either Approved or Rejected.

 

2016-12-02_141752

 

In a Root Folder called Customer, navigate to Datatypes/Database > User Defined Types > Folder Extension in the lower tabs, select, then enter a Customer Name in the Type field.  In our case, the name will be Mary Watson.

 

 

In the resulting Mary Watson subfolder, we will select Add Create Action from the lower tabs.  In the New Flow pop-up, we will call our flow “Apply for Financing” and click OK to open it in the Flow Designer.

 

 

First, we will place the Setup Process Folder component in our flow. We’ll find it in the All Steps [Catalog] > Flow Management > Data category of the Flow Designer’s startup window. Select it and click Add to add it to the workspace.

 

In the Properties tab, we will set Parent Folder to FlowInput, Make Unique to Number, and Flow Prefix to “FINANCING”.

 

 

In the Edit Input Mappings editor, we will map FolderId to Parent Folder Id, define Folder Name as “Financing Application”, and set the Anticipated Flow Time to 1 hour.

 

 

Next, we will define our process’s state as Started. We will find the Set State and State Reason component in the Toolbox tab, under the category Flow Management > Data

We will define state as “Started”.

 

 
 

We will give stateReason a Mapping Type of Text Merge Plain and define it as “Started by [Flow Data.CurrentUserEmail].”

 

 

Next, we will place the form that will accept applicant details. We’ll find it in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.

 

2016-12-02_103120

 

On submission, we want to change our process’s state to “Submitted”, so we will place another Set State and State Reason component. We will define state as “Submitted”.

We will give stateReason a Mapping Type of Text Merge Plain and define it as “Submitted by [Flow Data.CurrentUserEmail].”

 

 

Next, we will place the form that will display applicant details and give the user the option to Approve or Reject the application. We’ll find it in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.

 

2016-12-02_104319

 

In the Mapping Editor, we will map the Application form’s outputs to our Approval form’s inputs.

 

 

On approval, we would like to set the process’s state to Approved, so we will place another Set State and State Reason component at the end of the Approve outcome. We will define state as “Approved”.

We will give stateReason a Mapping Type of Text Merge Plain and define it as “Approved by [Flow Data.CurrentUserEmail].”

 

On rejection, we would like to set the process’s state to Rejected, so we will place another Set State and State Reason component at the end of the Deny outcome. 

We will define state as “Denied”.

We will give stateReason a Mapping Type of Text Merge Plain and define it as “Denied by [Flow Data.CurrentUserEmail].

 
 

After connecting the last of our outcomes, the flow will be completed. We will save it and close the Flow Designer.

 

To test our flow, we will go to a Customer folder and select the action Apply for Financing.

 

 

In the resulting pop-up, we will define the parameters of our application and click Done.

 

 

Back in our Customer folder, we will see that a process folder has been created: Financing Application 1. When we click to open the folder, we will be taken to the Process Data View of our application. In this view, we will see the comprehensive record of our process’s history and its current state. We will see that its current state is “Submitted”.

 

 

In the Applicant Details form of our flow, we will fill in the Comments field and click the Accept button.

 

 

Back in the Process Data View, we will see that our process is 100% completed with a final state of “Approved.”

 

 

Additional Resources