Setting a Process's State and State Reason
  • Updated on 09 May 2013
  • 3 minutes to read
  • Print
  • Dark
    Light

Setting a Process's State and State Reason

  • Print
  • Dark
    Light

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.png

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.

2018-07-06_113815.jpg

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.

2018-07-06_114101.jpg

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.
2018-07-06_123700.jpg

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

2018-07-06_131211.jpg

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.

2018-07-06_131509.jpg

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".

2018-07-06_131621.jpg

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

2018-07-06_131725.jpg

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.png

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]."

2018-07-06_133616.jpg

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.png

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

2018-07-06_134431.jpg

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]."
2018-07-06_134920.jpg

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].
2018-07-06_134955.jpg

After connecting the last of our outcomes, the flow will be completed. We will save it and close the Flow Designer.
2018-07-06_135102.jpg

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

2018-07-06_135218.jpg

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

2018-07-06_135727-1.jpg

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".

2018-07-06_140049-1.jpg

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

2018-07-06_140730.jpg

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

2018-07-06_140802.jpg

Was this article helpful?