Setting a Process’s State and State Reason

Last Updated: 07/19/2016 Introduced in Verision: 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.

processDataViewStarted

 

We will begin in the folder for our Customer custom folder extension: System > Common Data Elements > Folder Behavior Actions > UserType.CustomerFolderBehavior.

folderExtensionFolder

 

In the resulting New Flow pop-up, we will call our flow “Apply for Financing” and click OK to open it in the Flow Designer.

nameFlow

 

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.

 

 flowStarts

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

setProcessFolderPropertiws

 

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

setupProcessFolderMapping

 

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.

dragStateAndStateReason

 

In the Mapping Editor, we will define state as “Started”.

mappingStateStarted

 

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

mergeTextEditorStartedBy

 

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.

dragDetailsForm

 

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

dragStateAndReasonSubmited

 

In the Mapping Editor, we will define state as “Submitted”.

mappingStateSubmitted

 

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

mergeTextSubmitted

 

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.

dragApprovalForm

 

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

mappingForApprovalForm

 

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.

dragStateAndReasonApproved

 

In the Mapping Editor, we will define state as “Approved”.

mappingStateApproved

 

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

mergeTextApprovedBy

 

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 Reject outcome.

dragStateRejected

 

In the Mapping Editor, we will define state as “Rejected”.

mappingRejected

 

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

mergeTextRejected

 

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

flowFinished

 

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

applyForFinancing

 

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

runningForm1

 

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

processDataViewStarted

 

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

rejected

 

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

finalResult

 

Additional Resources