Modify the Telework Case Approval Flow
Now that we have created the People Finder Spoke and our Auto Approval Decision Table, let's modify the Telework Case Approval Flow to allow auto-approval for those that were pre-certified or have requested 3 days or less for Situational Telework.
Open the Telework Case Approval Flow and add our changes
- Return to the App Home tab in App Engine Studio.
- Open the Telework Case Approval flow by clicking on the row under Logic and Automation.
Toggle the Flow Designer view to Tree View.
First, we want to add a Flow Variable to store the status of auto approval.
- Click the button next to the Save button on the top-left of your screen.
- Select "Flow Variables" from the drop-down.
Click the plus sign ⨁ to add a variable.
Set up the flow variable.
Field Name Field Value ➊ Label Approved ➋ Name approved ❸ Type True/False ❹ Click on the 🆇 button to close. Before our first step, we want to call the People Finder Spoke. Hover above the "Ask for Approval" step and click the plus sign ⨁.
Add the People Finder Spoke
- Select "Action" as the step type.
- Search for "people finder".
- Select the "GET /user" action.
Click the data pill picker for email.
Dot-walk to the email address of the person that opened the request.
- Click "Trigger - Record Ceated"
- Click the blue arrow next to the "Telework Case" record to drill down.
- Click the blue arrow next to "Opened by".
- Click on "Email" to set the value.
Click the
button.
Next, we want to use the decision table we built. Hover in-between steps 2 and 3 and click the plus sign ⨁.
Add the Telework Auto Approval Decision Table.
- Select "Flow Logic" as the step type.
- Select "Make a decision" from the list.
Setup the decision step.
Field Name Field Value ➊ Decision Label Check auto approve conditions ➋ Decision Table Telework Auto Approval ❸ Execution First decision that matches ❹ Use Branches Un-check ❺ Telework Request Drag and drop data pill❻ Click on the button.Now, we have to check if either auto-approve condition has been met. Hover in-between steps 3 and 4 and click the plus sign ⨁.
Add the if condition.
- Select "Flow Logic" as the step type.
- Select "If" from the list.
Setup the if condition.
Field Name Field Value ➊ Condition Label If auto approve conditions are met ➋ Condition 1 Dot-walk (see step 18 below) ❸ Operator is ❹ Value Y ❺ Click on the button.❻ Condition 2 Dot-walk (see step 19 below) ❼ Operator is ❽ Value True ❾ Click on the button.Dot-walk Condition 1 (step 2 above)
- Click "2 - GET /User"
- Click the blue arrow next to the "output" object to drill down.
- Click on "telework-certified" to set the value.
Dot-walk Condition 2 (step 2 above)
- Click "3 - Make A Decision"
- Click the blue arrow next to the "Decision Table Multiple Result Record" record to drill down.
- Click the blue arrow next to the "Result elements" glide_var to drill down.
- Click on "Auto Approved" to set the value.
Let's set the Approved value to true.
- Select "Flow Logic" as the step type.
- Select "Set Flow Variables" from the list.
To add a flow variable to set, click the plus sign ⨁.
Set the Approved flow variable to true.
- Select "Approved | True/False" from the drop-down.
- Check the data box for true.
- Click the
Now let's add the flow logic for when our condition is not met. Hover above step 6 and click the plus sign ⨁.
Add the else condition.
- Select "Flow Logic" as the step type.
- Select "Else" from the list.
Move the ask for approval action.
- Hover next to step 7 until you see and cross-shape and the text appears "Drag to reorder steps".
- Drag step 7 onto the plus sign ⨁ under step 6.
Move the if condition for then manager approves.
- Hover next to step 8 until you see and cross-shape and the text appears "Drag to reorder steps".
- Drag step 8 onto the plus sign ⨁ under step 7.
Now let's set the flow variable when the manager approves. Hover above step 9 and click the plus sign ⨁.
Set the Approval flow variable to true.
- Select "Flow Logic" as the action type.
- Select "Set Flow Variables" from the list.
To add a flow variable to set, click the plus sign ⨁.
Set the Approved flow variable to true.
- Drag and drop the flow variable from the data pills on the right side of the screen into the Name field.
- Check the data box for true.
- Click the
Let's return to our mainline logic and add a new step.
Add the if condition.
- Select "Flow Logic" as the step type.
- Select "If" from the list.
Setup the if condition.
Field Name Field Value ➊ Condition Label If all approve conditions are met ➋ Condition 1 Drag and drop data pill❸ Operator is ❹ Value True ❺ Click on the button.Delete the step placeholder under step 12.
Move the Create Task step.
- Hover next to step 10 until you see and cross-shape and the text appears "Drag to reorder steps".
- Drag step 10 onto the plus sign ⨁ under the then condition in step 12.
Move the Send Email step.
- Hover next to the new step 10 until you see and cross-shape and the text appears "Drag to reorder steps".
- Drag step 10 onto the plus sign ⨁ under the new step 12 (Create Task).
Save the changes to the Main flow by clicking the
button.
Activate the Main flow by clicking the
button.
Bonus
Do you remeber hot to test your flow from the previous lab? Test your work using what you've learned!