Screen flow Usage and Configurations in Pega
This is one of the interesting topics in flow rule (at least to me :)) In this blog article, we will understand the different configurations in the screen flow.
I believe most of the Indian IT guys use (or used) cleartax to file their income tax. The best thing about Cleartax is its excellent user interface. By the way, we don’t endorse on cleartax, just an UI inspiration 🙂
Just look at the below picture
It looks simple and neat to me!
You can see, they have defined five steps in Income tax filing. You can switch between tabs and fill all the necessary details.
We can review this screen technically.
– Considering tax filing as a flow, they have defined 5 screens.
– Users can easily switch between screens – validations ( name mandatory) are not fired when you switch screens). You can also go back to the previous screen and correct details.
– All the collectable details are neatly aggregated under respective screens
– No dependency with other people. I mean If I start the IT return, I can go ahead and fill in the details in all the screens
Ok, Now Pega.
If your client gives you similar requirements to build a user interface, Screen flow is your solution!
Let’s straight away create a new screen flow for clear tax
How to create a new screen flow?
Step 1: Create a new flow. Records -> Process -> Flow -> Create
Step 2: This is an important configuration for screen flow. Click on view additional configuration options and choose select standard template for screen flows.
This will render the flow rule in screen flow template. There are certain differences between screen flow and standard flow. We will see it later in the post.
Create and Open
Step 3: Start adding assignment shapes within the start and end shapes. Each assignment shape refers to a screen. You can pull in a series of assignment shapes in a screen flow.
What are the configuration points in the screen flow?
Before checking the configuration points, please perform the below pre-requisite steps to follow me in this tutorial
Note: Screen flows cannot create a new work object. You can see in the process tab, it is read only
It means, you cannot run and test a screen flow. For testing, I have added the flow in my sales case, which I created earlier
I have added it as a first stage. You can add by clicking step -> processes -> clear tax ( it lists the flows in the class hierarchy) and then select to add it. I’ve already added.
You can also add it in any starter flow and run the flow instead of case.
Now, Let’s start with the start shape. Go to the flow rule and double click to open the start shape properties.
Configuration points in start shape
a) Harness
It gives a layout for your screen. The default harness selected is TabbedScreenFlow7. Run the case, to process the screen flow and see the harness view in real time
You can see the screen title are in tabbed format
Just switch it to TreeNavigation7 to view the harness type
You can specialize your own harness and include here.
b) Save on last step
We know that, Pega uses database to persist the data.
Normally in standard flow, whenever you process (submit) any assignment then commit happens automatically and the entered details will be saved in the database table, but in screen flow, you get an option to commit only at the end of the last step (screen) . Again a difference, note it down
Note: As a best practise, Pega recommends to use Save on last step. You don’t want to commit every time that can improve performance with database connections
c) Allow errors
Allow errors will be visible only when you check Save on last step. You know why?! 🙂 Pega don’t want to allow error data when you are saving at each screen.
So when you are saving on the last step, you get an option to perform validation at each step or at the last step. Again this is your design choice.
If you want to mimic clear tax, then you should allow errors, so that users can switch between screens and fill the details without any dependency on screens, but remember you cannot complete the entire flow, without correcting errors!
d) Routing
This is the key feature. So routing is decided at the start shape. It directly means, only one operator can perform the screen flow process. Ideally, that will be the requirement always for a screen flow. No dependency with other people.
Here, you can use any activity of type router. Pega provides a lot of OOTB router activities like ToWorklist, ToCurrentOperator, etc
Please don’t think it smart to include ToWorkbasket router activity and assume, that people who can access Workbasket can work on the ScreenFlow parallel.
If you try like that, then Pega will catch you saying don’t cheat me 😉
So only a Pega operator can work on the screen flow. Hence proved.
So I mentioned the router as ToCurrentOperator.
We are done with configuring start shape.
Configuration points in assignment shape
a) Flow action
This is another major difference between screen flow and standard flow. In standard flow, you can configure flow actions on the outgoing connector from the assignment shape. It means you have a choice to perform more than one flowactions ( or simply actions) in standard flow. But in screen flow, flow actions can be configured only in the assignment shape, and thus you cannot have more than more flowactions from an assignment shape.
Yeah, we don’t need that right in screen flow 🙂
b) Navigation link
We know that we can navigate between screens using tree nodes or tabs based on the harness. So each screen has a navigation link to jump between screens.
Note: You can also jump to previous or next screens using action area buttons.The screenflow action area buttons come with next, back buttons. So you can switch between tabs using navigation link or next/continue, back buttons
It’s good to have the Enable navigation link checked for all screens, that serves the purpose of screen flow well.
But really if you don’t want to provide a navigation link to a screen, you can easily switch it off.
I am switching it Off for the third screen, Deductions
Save and run the case.
Even though you are in deductions step, you cannot see Deductions link !!
c) Only allow navigating back to this step
The tooltip description speaks.
On selecting this, You cannot fast forward or jump forward tabs using navigation trail
Sometimes, navigation links were referred bread crumbs, remember Hansel and Gretel story:D . Think, think
I am going to enable this in the last 4 screens, except the first.
Run the case. You can see the 4 steps were disabled, you cannot jump forward using breadcrumbs.
Click 2 times next/continue button to go to 3rd screen.
Now, the screen screen is enabled, you can jump back using bread crumbs. So once you crossed the screen, you can always jump back.
d) Perform post-processing when navigating away from step
This is also related to navigation link.
We know that post-processing activities and validations can be configured in flow actions. So normally when a flow action is submitted the post-processing and validations fire. Submitting here refers to clicking on the buttons (next) to complete the assignment
Note: Validation can be controlled by allowing errors in screen flow.
What happens when we navigate using bread-crumbs instead of standard buttons? will the post-processing work? You know the answer now, you can either enable or disable 🙂
These are the interesting configurations in assignment shape.
End shape is not much interesting!! Just the status
Note: Screen flow is not only about start shape, assignment shapes and end shape. You can include other shapes as well. For example decision shape. Some shapes might have limitation, for example in sub process, you can only refer other screen flows that use the same harness
What are the differences between standard flow and screen flow?
1. Starter flow – Screen flow cannot be a starter flow and so cannot create a new workobject.
2. Routing – In screen flow, routing is configured only in the start shape. It can be routed only to operators and the same (only one) operator is responsible for completing all the steps. You cannot route a screen flow to different operators. In standard flow, you can perform the exact opposite, where routing is configured in assignment shapes.
3. Single harness – Screen flow uses single harness which is configured at the start shape, where as in starter flow, different harness can be used in different assignment shapes
4. Commit at last – In screen flow, you get an option to commit at the last assignment shape, where as in standard flow, commit occurs on submitting every assignment shape
5. Flow action configuration – In screen flow, flow action is configured in the assignment shape and can be only one flow action per assignment shape, where as in standard flow, flow actions are configured from the outgoing connectors from assignment shape and can be more than 1.
6. Jump back – In screen flow you can configure the navigation links, to jump back and forth
7. Restriction on other shapes – few shapes are restricted to screen flows. For example in sub process, you can only refer screen flows that use the same harness