Setting Up Interceptor Pattern
  • Updated on 29 Sep 2016
  • 2 minutes to read
  • Print
  • Dark
    Light

Setting Up Interceptor Pattern

  • Print
  • Dark
    Light

Note : in order to use Rule Sets and Interceptor Rules , Decisions.FlowSets Module should be installed. To learn how to install Module in Decisions please click here .

This tutorial demonstrates how to set up Interceptor Pattern in Decisions 4.0.
Interceptor Pattern is a process of validating data in a workflow, stopping workflow on invalid data, and storing intercepted data for further analysis and user interactions.
Example:
In this example simulate a process that needs Interceptor Pattern implementation.
Begin in the Designer Folder with clickingCreate Flow button on the Folder Actions Panel.
2018-09-10_160957.jpg

Then, Name the Flow and select Create to proceed to theFlow Designer.
2018-09-10_161217.jpg

Add Fetch Entities step from the Steps panel. Configure the Type Name to be Account[DecisionsFramework].
2018-09-12_153723.jpg

Next, add a ForEach Step .
2018-09-12_153755.jpg

The ForEach step Type needs to be set as Account and the collection is the EntityResults that is passed from the FetchEntities step.
2018-09-12_155306-1.jpg

On the Next path from the ForEach step, add a Run Rule Set step.
2018-09-12_153942.jpg

Next, select Run Rule Step on the work-space and select All > Create Rule Set on Edit Step Actions Panel.
2018-09-12_154046.jpg

In the resultingCreate Rule Set window, Name the Rule Set , select Current Row Flow data to be exposed as Rule Set input and select Ok to save and continue.
2018-09-12_154118.jpg

The Rule Set Folder opens in a new window. OnFolder Actions Panel, select Setup Rule Set .
2018-09-12_154201.jpg

In theRule Set Settings, scroll down to Rule Types Section and check Allow Interceptor Rules check-box. This allows the creation of Interceptor Rules in this Rule Set . Select SAVE to save and continue.
2018-09-12_154231.jpg

Back in the Rule Set Folder we click Add Rule > Intercept on Folder Actions Panel.
2018-09-12_154258.jpg

Then, Name the Rule and select Create Rule to proceed to the Rule Designer.
2018-09-12_154716.jpg

In the Rule Designer, build a Rule that is going to intercept an Account with empty First Name.
See that Item data is available in theRule Designer because this Rule is a part of the Rule Set. Expand Item , pick FirstName and select Next .
In the verb definition window choose Is Empty and select Done .
This completes the Interceptor Rule . Save the Rule and close Rule Designer.
2018-09-12_161921.jpg

Next, navigate back to our flow . Run Rule Set step needs Rule Set Run Name to be configured. This setting is required because it will indicate a Name of intercepted data. In this example, configure it using Text Merge Plain Mapping Type. Use Item.EmailAddress.
2018-09-12_162205.jpg

Then, we save the Flow and select Debug .
2018-09-12_161102.jpg

Our Rule Set Folder opens in a new window. OnFolder Actions Panel we click Setup Rule Set .
2018-09-12_161941-1.jpg

Then, we navigate to our Rule Set Folder.
In the Rule Set Folder System created Rule Set Results sub-folder to store our Rule Set Data . We navigate to Rule Set Results.
2018-09-12_162346.jpg

In the Rule Set Results Folder we can see that our Interceptor Rule stored one Record (first row in the excel file) because Full Name was empty. At this point our Process Flow is stopped on the First Record from excel file before Add Record To External System step. Intercepted Data is stored. Interceptor Pattern will continue Process Flow after we implement Full Name Empty intercepted data handling.
2018-09-12_162408.jpg

Was this article helpful?