Restricting Data By Rules

Last Updated: 08/18/2016 Introduced in Verision: 2.0

This tutorial demonstrates how a Portal administrator can restrict designers from using desirable fields in Data Structure. This feature was implemented in Decisions 3.2.0.

Example:

In this example we are going to apply Data Restriction Rules against Account data type. First, we will create a Rule that will display only data fields that start with “a” under Account data type. Second, we will modify our Rule to display only data fields of String type. Lastly, we will modify our Rule in the way that if initiating user’s email address contains “admin”, he or she will not be able to use any data fields under Account data type.

We navigate to the System > Designers > Toolbox Customization > Data Rules Folder in the Portal. Then, we click Add Data Rule button on the Folder Actions Panel.

addDataRule

In the resulting window we Name our Data Rule and pick Data Type this rule is going to be applied. Click Ok to create the Rule.

nameAndTypeForTheRule

Next, we locate a thumbnail that was created for our Rule and click Actions > Edit Rule.

editRule

Rule Designer opens and we click Add New Rule Step button from the Start Rule window.

addNewRuleStep

Rule Phrase Builder pops up and we pick name [String] and click Next. This Rule Input represents data field Name under the Data Type we creating this Rule for. Additionally, we check Not checkbox for Rule to output the opposite result. This is done to ‘Rule Out’ data element from Data Type.

pickName

 

In the Verb definition window we pick Starts With from Text Rules category and click Next.

nameStartsWith

 

In the Inputs Configuration window we define Constant Mapping Type with Value “a”. Then, click Done.

nameStartsWithA

 

We can Close Rule Phrase Builder.

closeNameStartsPhrase

 

This completes our Rule design and it looks like the following… We can save and close Rule Designer.

ruleNameDone

 

In order to test this Data Restriction Rule we can navigate into the Flow Editor where Account Data Structure is being used, and check what data fields are visible under Account field. We verify that we are able to see only data fields that starts with “A”, as designed.

accountDataRuledOut

Next, we return to our Rule and delete the Rule Phrase we have defined. Then, we Add New Condition to the Rule, pick dataType [String], check Not checkbox, and click Next.

dataType

 

In the Verb definition we pick Contains from the Text Rules category and click Next.

dataTypeContains

 

In the Rule Inputs Configuration window we define input with Constant Value Type “string” and click Done.

datatypeContainsString

 

 

Now, our Rule looks as following…

datatypeDone

 

When we check what data fields are available for us under Account type in the Flow, we confirm that there are only data fields of type String.

ruledOutByStrings

We return to our Rule Editor and delete the existing Rule Phrase again. This time we check leave Not checkbox in the Rule Phrase builder unchecked. Then, we expand Flow Data [Rule Constant Data] category, pick InitiatingUserEmail [String] and click Next.

userEmail

 

In the Verb definition window we pick Contains from the Text Rules category and click Next.

userEmailContains

 

Finally, in the Inputs Configuration Rule Phrase Builder window we define Constant input with “admin” Value. Click Done when finished.

userEmailContainsAdmin

 

Our Rule looks as following… We can save it and close Rule Designer.

userEmailFinished

 

When we navigate to the Flow Editor and check Account data type, we can confirm that we are not able to operate with any Account type data fields because our email address is admin@decisions.com.

ruledOutByEmail

Additional Resources