Truth Table and Simple Approval Chain

Last Updated: 07/15/2016 Introduced in Verision: 3.2

This tutorial demonstrates how to use Truth Table and simple Approval Chain to create ad hoc approval applications.

Example:

In this example we are going to use a Truth Table that outputs an Approval Chain based on the input.

We begin in the Designer Folder with clicking Create Rule > Create Truth Table on the Folder Actions Panel.

createTruthTable

Then, we Name our Truth Table and click Create to proceed to the Rule Designer.

nameTruthTable

In the Rule Designer we locate Output Section and using Output Type picker select Approval Chain type.

outputApprovalChain

Then, we Ignore Outcome Data [Default]

ignoreDefaultOutput

Next, in the Rule Input Data we click Add New link to add an input for the Truth Table. We Name the input and define its type String. Click Ok to save and close Rule Input definition window.

addRuleInputs

Next, on the workspace we are going to define a condition for the Truth Table. First, click on [no anchor data] and select Rule Input that we defined for this Truth Table.

useInputAnchor

Next, we click [n/a] and pick Equals verb for the Truth Table condition.

useVerbForRule

Then, we click [ignored] link under ApproverEmail Equals and define a Constantadmin@decisions.comEmail.

createFirstRow

Next, under Result we click [ignore]. Because our Truth Table outputs Approval Chain, we can build a Constant Simple Approval Chain. For the Approval Chain Value we click ellipses to create an Approval Chain. In the resulting window we Add Account to the first level of approvers.

createSimpleApprovalChainFirst

Then, we are going to pick admin Account because this is the case of Truth Table where the input will be admin Account. Click Ok to confirm picked Account.

pickAccount

Save and close Approval Chain editor and close the Result Mapping Editor.

saveFirstApprovalChain

Then, we click add row link to create second case of the Approval Chain.

addRow

In the same manner we define Constant Input email to the Truth Table and create Constant Approval Chain. Add Account to the first level of Approvers.

createApprovalSecond

Pick an existing Account that matches your Input for this row and click Ok. Save and close row definition editor.

pickAccountSecond

Our Truth Table is completed. We can save it and close Rule Designer.

truthTableCompleted

Next, we are going to create a simple Flow to demonstrate the use of the Truth Table that outputs Approval Chain based on the input. In the Designer Folder we click Create Flow on the Folder Actions Panel.

createFlow

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.

nameFlow

In the Flow Designer we add Show Form component from the Favorite Steps category. We are going to create a simple Form where User should be able to pick Approver.

addShowForm

In the resulting window we Name the Form and click Create to proceed to the Form Designer.

createForm

Our Form is designed with a Title (Label component), Radio Button List that represents two options for the Truth Table, and a Submit Button. When finished designing the Form, we can save the Form and close Form Designer.

fornDesign

Back in the Flow Designer we add our Truth Table… Add [Pick or Create Truth Table] step from the Flows, Rules, Forms and Reports > Rules category.

addPickTruthTable

Then, click Pick or Create Truth Table link.

pickTruthTable

Next, locate our Truth Table and click Pick.

selectTruthTable

In the resulting window pick Select Value Mapping type for ApprovalEmail input to the Truth Table.

selectValue

Then, using Path picker select SelectedApprover outcome from the Form and click Ok.

pickDataForTruthTableMapping

Next, add Run Approval Flow step from Integrations > Approvals > Advanced category.

addRunApprovalFlow

Then, we simply connect all outcomes from the Run Approval Flow step to the End step in our Flow. In this example we are not going to build any additional processes on each outcome from the Run Approval Flow step because it is out of this tutorial’s scope.

connectSteps

Select Run Approval Flow step on the workspace and select Show Mapping Editor option.

showMappingEditorForApproval

In the Mapping Editor we are going to connect First Approval Chain from the outcome from the Truth Table to the Approval Chain field. Then, for the simplicity of this example we Ignore other inputs into Run Approval Flow step. Save and close Mapping Editor.

mapApprovalChain

This completes our Flow. To test it, we can click Debug Flow link on the top panel of the Flow Designer.

Note that in Decisions version 3.5 and above, you’ll need to click Test Flow to access the Debugger.

3.5 Test Flow Shot

debugFlow

We are executing this Flow under admin Account. Select admin Account on the Form and click Submit.

selectApproverDebug

The Flow keeps executing and the Approval Form is being assigned to us because admin Account input to the Truth Table caused it to output an Approval Chain where admin is the only responsible approver. We click Yes to fill in the assigned Form.

fillAssignedForm

The Approval Form opens up. We fill it in and submit.

submitForm

Then, the Flow executes to the end with no issues.

flowExecuted

Next, we are rerunning the Flow and select different Approver. This time Truth Table executes with different Approval Chain and assigns Approval Form to another account.

selectAnotherApprover

We log in as the assigned user…

loginAsSecondApprover

The assigned Approval Form shows up on the Home Page.

completeAssignment

We click it and select to fill the Form in.

fillInForm

Fill in the Form and submit.

completeAssignedForm

 

Additional Resources