Press "Enter" to skip to content

What is rule availability in Pega?

93

Introduction

In this post we will see more in details about the rule availability.

  • Let me start this post with a story.
  • I invited my close friends for a party in a whatsapp group. I asked them to send a confirmation reply.

Friend 1: I am always ready to attend the party (Bestie :D)

Friend 2: I am not available for the party.

Friend 3: I won’t come for the party. I will not allow my friends too !!

Friend 4: I am ready to come for the party, but I got a family function blocking that day

Friend 5: I am coming. This is my decision and no one can change it.

So sad. I got positive response from only two people. I cancelled the party and started writing a new post for you guys. ‘Rule availability’

  • I find there are many similarities between my friends availability and rule availability.

I asked 5 rules to run 😀

Rule 1: I will run for you (Available)

Rule 2: I will not run for you. (Not available)

Rule 3: I will not run for you, I will not allow rules in my lower version to run. (Withdrawn)

Rule 4: I can run for you, but I am blocked (Blocked)

Rule 5: I will run for you. You cannot update me (can be updated in same open version)

What is rule availability?

  • Rule availability helps in managing rules. They can determine, if the rule is eligible to run or not. They can also determine the availability of rule in lower versions.
  • In the rule form, you can configure the rule availability.

Why do you use rule availability?

Scenario: there may be some scenario, where don’t want a particular rule to run in the application. You can use the availability feature in the rule form to make the rule not available  for rule resolution.

  • We know, Pega use different  rules to support a business process.

For example – when you create a new work item, there are many rules involved to complete the task like flows, activities, when etc. Some rules in the framework can be overridden in the Implementation layer.

  • Rule resolution, helps in picking the right rule.

What are the types of rule availability in Pega?

  1. Available
  2. Not Available
  3. Withdrawn
  4. Blocked
  5. Final

We will explore all the possible by rule availability scenarios with examples.

What are the pre-requisites to test rule availability?

You can test using any rule. In this tutorial I am going to guide you through activity rules.

Create 2 new activities.

  1. ParentAvailable
  2. ChildAvailable

Parent activity – Use ‘Call’ keyword and call child activity from parent activity.

Child activity – For testing purpose, use a property-set to set pyLabel – “Child rule is available”

 

  • Create a new section, and include some fields. Have a button control. In the button, On click event add an action set to call the parent activity.

How do you configure rule availability?

You can use Live UI and check the property involved in holding the availability value in rule form. – ‘pyRuleAvailable’.

You can see the property ‘pyRuleAvailable’ in the rule class contains the availability value.

How do you use different availablity options?

a) Available – As the name suggests, the rule is always available to run.

Here I have configured both the activities, parent & child activities  ‘Available’.

This is very simple to test. The rule will run anyways 😀

Step 1: Open the section in user portal.

Step 2: Start the tracer & click on the check availability button.

you can see the child activity ran. It is available 🙂

I think its enough for rule available

b) Not Available

  • Using this option, you can make a rule not available in particular version.

For example – Say you have a rule in 2 versions : 01-01-01 & 01-01-02. Default rule resolution always picks the highest version. In our case 01-01-02.

Now, here if you want your rule in 01-01-01 to run, then you can make the rule availability in 01-01-02 to ‘No’

Note: You always use this in development environment. There is no use in moving a rule to higher environment with rule availablity set to ‘No’. You can just delete it right 😀

So when you actually use?

  • In development environment, say you have a rule in 01-01-01.
  • You saved the rule in higher version 01-01-02 and did some drastic changes. When you test the rule, it throws error.
  • You need to check, how it worked previously 🙂

So instead of deleting the rule in 01-01-02, you can make the rule availability to ‘No’.

The rule resolution invalidates the rule with availability set to ‘Not Available’, so it runs the rule in 01-01-01.

We will test and check how this works.

Step 1: Save As the child activity in 01-01-02 and set pyLabel to ‘Availability No checking’.

Step 2: Click on the button. As of now keep it available and use tracer to check the value.

You can see ChildAvailable in MyKnowPega 01-01-02 gets picked and pyLabel is ‘Availability No checking’

Step 3: Now update the availability in 01-01-02 to ‘Not Available’.

Step 4: Lets check the same in user portal again. trace it.

See, now you can see the rule in 01-01-01 is picked.

You can use this for testing in development environment 🙂

c) Withdrawn

  • Selection this option makes the rule in the current version and previous versions in the same ruleset, withdrawn from the rule resolution. It means rule resolution, invalidates the withdrawn rule and its other lower versions in the same ruleset.

For example – You have your rule in MyKnowPega 01-01-01 version and updated the rule in MyKnowPega 01-01-02 version. When you withdraw the rule in 01-01-02 version, then the rule resolution never pick the rule in both 01-01-02 & underlying versions – 01-01-01.

What are the other scenarios , you withdraw a rule?

  • You override an pega OOTB rule in your application ruleset. You started implementing your own requirement. In later release, Pega provides the same feature in their OOTB activity, So you no longer required the overridden activity in your application ruleset.

What will you do here?

You cannot delete the rule, since the rule is packed and moved to higher environment.

All you can do is save as the rule in higher application ruleset and withdraw the rule. You can move the withdrawn rule to higher environment. So it invalidates rule in lower versions too 🙂

  • You have a rule say – ‘discount flow’ in ‘OIKGGB-MyKnowPega-Work’ .
  • You Overridden the flow in ‘OIKGGB-MyKnowPega-Work-AmazonSales’ class for Amazon sales case.
  • After some particular release, You included all the Amazon sales discount process in the ‘OIKGGB-MyKnowPega-Work’ class generic flow. So now, no use in having a specialized version in Amazon sales class.

What will you do here?

You can withdraw the rule you specified in the ‘OIKGGB-MyKnowPega-Work-AmazonSales’ class. So rule resolution picks the rule from ‘OIKGGB-MyKnowPega-Work’ class.

Let’s test the withdrawn rules

Step 1: Create a new copy of the ChildAvailable rule in Application Integration ruleset.

 

Note: But this MyKnowPegaInt ruleset always comes under MyKnowPega (Implementation ruleset) in ruleset hierarchy. Rule resolution always picks the rule  in higher ruleset in the hierarchy. In our case – MyKnowPega

Step 2: let’s test using tracer.

You can see the rule in MyKnowPega 01-01-02 is picked.

Step 3: Now let’s withdraw the rule from MyKnowPega 01-01-02 version.

Step 4: Let’ check in the user portal using tracer.

You can see the rule is picked from MyKnowPegaInt ruleset 🙂

What are the differences between ‘Not Available’ and ‘Withdrawn’ rule?

  • ‘Not Available’ invalidates the rule only in the current version, where as the ‘Withdrawn’ invalidates the rule in the current version and lower versions in the same ruleset.
  • Mostly we use ‘Not Available’ only in development environment and don’t promote those to higher environments, where as the ‘Withdrawn’ rules can be moved to higher environment 🙂

d) Blocked

  • Selecting this option will not invalidate the blocked rule for rule resolution. Still the blocked rule is right candidate and if the rule gets picked by rule resolution, then the process returns not found.

When do you block a rule?

  • Say for example, Amazon needs to stop their online electronics sales for a particular country. It can be resumed in later point of time. In this case you can block the respective rules. The rules just throw the error to end user.
  • In development environment, If you didn’t complete the entire development, you can block the corresponding rule till then.

Let’ test a blocked rule.

Step 1: Save As the child activity and make the availability to ‘Blocked’.

 

Step 2: Check in the user portal. Trace it.

You can see the exception thrown. Since we are testing it using button call, it never stops flow processing(kind of local action). So let’s test by using the activity in flow action post processing activity.

Step 3: Open the flowaction – add the ‘ParentAvailable’ activity in Post-processing activity.

step 4: Now submit the flowaction in user portal.

You can see the error thrown. the process is blocked 🙂

e) Final

  • On Selecting this option, you are making a rule as final rule. You cannot override a final rule in another ruleset.
  • When you try save as the rule, you will get an error.

Note: You can save as the Final rule in the same ruleset in higher versions 🙂

When do you make a rule final?

  • In my point of view, Pega introduced the ‘Final’ availability to restrict developers updating the core designer studio engine rules.
  • If you are sure that the rule cannot be reused in any other rulesets. It means you will never Save As the same rule to use in other rulesets ( We use it rarely 🙂 )

For example: You can check underlying sections in any rule form header. Pega makes the sections, rules final, because they don’t want us to update those in rules in our application rulesets.

Let’ test the final rule availability

Step 1: Open any final rule OOTB rule.

Section – RuleFormHeader

Step 2: Try Save As the rule in  your application ruleset.

It means you cannot copy a Final rule in different rulesets 🙂

We can try copying a final rule in same ruleset higher version

Step 1: Open the child activity and set the availability to ‘Final’.

Step 2: Now try Save As in the next ruleset version 01-01-02.

You are able to make a copy only in the same ruleset higher versions 😊

What are the things to remember?

  • Rule availability: Available – Rule is always ready to run
  • Rule availability: Not available – Rule is not available to run. Rule resolution invalidates the rule.
  • Rule availability: Withdrawn – The withdrawn rule as well as the lower versions in the same ruleset are not available to run
  • Rule availability: Blocked – the blocked rule throws exception when it runs. Rule resolution don’t invalidate the rule
  • Rule availability: Final – You cannot specialize the Final rule in other rulesets. You can Save As only in higher versions in same ruleset.

 

  1. Raghav Raghav

    Good one, keep posting, thanks a lot !!

    • Premkumar G Premkumar G

      Thank you so much, Raghav. 🙂
      I’ll keep on posting for sure. Glad to know that you like it. 🙂

  2. Bramha Bramha

    Good Explanation Bro….

    Thanks for Posting….

    • Premkumar G Premkumar G

      Thank you so much, bro. 🙂
      You are welcome bro. 🙂

  3. Bhagiradha Bhagiradha

    Good comparison with real time example

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Bhagiradha 🙂

  4. swapna swapna

    Very good explanation. Can u please give more explanations with real time scenarios. And one more request pl can u explain all the topics by creating an example application.

    • Premkumar G Premkumar G

      Thanks for your comments, Swapna. Once I complete some important topics, I will connect all dots by creating a sample application.

  5. Thejaswi Thejaswi

    Easily understandable.Thank you so much ☺️

    • Premkumar G Premkumar G

      Thank you so much, Thejaswi. 🙂
      Glad to hear that you like it. 🙂

  6. Suresh Suresh

    So nice of your explanation and sharing info to all.

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Suresh. 🙂
      Glad that you like it. 🙂

  7. Rama krishna Rama krishna

    You are really great bro…Keep posting. Thanks a lot 🙂

    • Premkumar G Premkumar G

      Thank you so much for your encouraging words, Rama krishna. 🙂
      Yeah bro, I will definitely keep on posting.
      It is my pleasure bro. 🙂

  8. Suresh Suresh

    Bro the way u r explained good

    • Premkumar G Premkumar G

      Thank you so much, Suresh. 🙂

  9. Navakanth Navakanth

    Good Explanation Prem…..with the examples…
    Thx for ur posts.

    • Premkumar G Premkumar G

      Thank you so much for your words, Navakanth. 🙂
      You are welcome. 🙂

  10. Ravi Ravi

    good explanation. Thanks Prem.

    • Premkumar G Premkumar G

      Thank you so much, Ravi. 🙂
      You are most welcome. 🙂

  11. Manju Manju

    Thank u so much….

    • Premkumar G Premkumar G

      You are most welcome, Manju. 🙂

  12. Ashwini Ashwini

    Good work Prem… 🙂 The explanation given is simple and easy to understand. Keep doing this work… Very helpful for learning guys like me 🙂

    • Premkumar G Premkumar G

      Thank you so much for your encouraging words, Ashwini. 🙂
      Happy to hear that you find it useful. Yeah, I’ll keep on posting new stuffs. 🙂
      Stay tuned. 🙂

  13. Ajay Ajay

    Very Nicely Explained . Keep the Good work.

    Can you please explain Cover ,Folder and also their locking and other dependency features on Cover ,Folder and Work Object.
    It will be great help.

    Thanks

    • Premkumar G Premkumar G

      Yeah sure Ajay. You will get that on my case management post 🙂

  14. Veera Veera

    Really nice and learning so many things from the blog.
    Thank you so much for your efforts.

    • Premkumar G Premkumar G

      Excited to hear that you find my website useful. 🙂
      You are most welcome, Veera. 🙂

  15. syamson syamson

    great help pavan.. thanks a lot..

  16. Sruthi Sruthi

    Thank you for the post 🙂

    Could you post info on harnesses and portals ?

    • Premkumar G Premkumar G

      You are welcome, Sruthi. 🙂
      Yeah, I’ll post about them soon, Sruthi. Stay tuned. 🙂

  17. Pradeep Pradeep

    Great work Prem, keep continue with real time scenarios

    • Premkumar G Premkumar G

      Thank you so much, Pradeep. 🙂
      Yeah sure, Pradeep. I’ll keep on explaining with real time cases.

  18. Prem, It would be great if you can provide some main OOTB activities and its purpose.

    Thank you.

    • Premkumar G Premkumar G

      Yeah sure Veera. I will try to make a post on commonly used OOTB activities.

      Meanwhile you can check the main OOTB activities in the below path

      Designer studio -> Process and rules -> Processes -> API s

  19. Udhay Udhay

    Neeyellam nalla varanum da..keep up the good work….:)

    • Premkumar G Premkumar G

      Thank you so much, Udhay. 🙂

  20. Shweta Shweta

    Very Nice and simple Explanation.

    • Premkumar G Premkumar G

      Thank you so much, Shweta. 🙂

  21. Chethan Chethan

    Good work buddy as always 🙂

    • Premkumar G Premkumar G

      Thank you so much, Chethan. 🙂

  22. subbaraju chitamaneni subbaraju chitamaneni

    Wonderful example, we never forget.

    • Premkumar G Premkumar G

      Thank you so much, Subbaraju. 🙂
      Glad that you like it. 🙂

  23. Rupesh Rupesh

    Hi Prem,

    Good Explaination.

    can you please post case management concepts and report definition asap.

    Thanks

    • Premkumar G Premkumar G

      Hi Rupesh,

      Thank you so much. 🙂
      Yeah, I will post about that soon. 🙂

  24. soumya soumya

    Hi prem
    I need some information regarding rule delegation ,pls explain me .

    • Premkumar G Premkumar G

      Hi soumya,

      I will try to make a post on rule delegation soon 🙂

  25. Vasanth Vasanth

    Hi Prem,

    Great blogs on rule availability.

    Can you please clarify one thing – blocking a rule means is it block for specific ruleset or all ruleset?

    • Premkumar G Premkumar G

      Hi Vasanth,

      Sorry for the late reply.
      I hope you meant to ask for specific version or all versions.
      It is always specific to a particular version alone 🙂

  26. Chandra Chandra

    Thanks Prem.. your post cleared many of my doubts about rule resolution. That’s a great work.

    • Premkumar G Premkumar G

      You are most welcome, Chandra. 🙂
      Thank you. 🙂

  27. Sathish Sathish

    good example. u doing great dear

    • Premkumar G Premkumar G

      Thank you so much, Sathish. 🙂

  28. Sathish Sathish

    good example. u doing great dear

    • Premkumar G Premkumar G

      Thank you so much, Sathish. 🙂

  29. Ashwani Mishra Ashwani Mishra

    Could you please post an article about Rule Resolution?

    • Premkumar G Premkumar G

      Sure Ashwani. I will try to make it soon 🙂

  30. ramachandra ramachandra

    Hii Prem,
    Could you make a post on Rule Resolution…

    • Premkumar G Premkumar G

      Hi Ramachandra,

      I’ve noted down about Rule resolution. I will try to post about it soon. 🙂

  31. Bhanu Bhanu

    Excellent portal to go through Pega in simple words with superb examples. Keep up the good work Prem. Will be looking for more and more posts.😃

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Bhanu. 🙂
      Glad to hear from you. 😀
      Stay tuned for more posts. 🙂

  32. PMK PMK

    Thank you very much really I am enjoying to learn with your explanation Keep going

    • Premkumar G Premkumar G

      Glad to hear from you that you like it. 🙂

  33. Charan Charan

    Nice Explanation Prem. Your posts are very useful. Thanks for the posts. Can you please post an article on Page context in activities ?
    Thanks inadvance.

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Charan. 🙂
      Glad to hear that you find my posts useful. 🙂
      You are most welcome. 🙂
      I’ll explain about Page context in upcoming posts. Stay tuned. 🙂

  34. Rajesh Rajesh

    This is simply superb and am able to understand very easily.
    Looking for many more topics . Thanks 🙂

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Rajesh. 🙂
      Stay tuned and I’ll keep on updating. 🙂
      You are most welcome, Rajesh. 🙂

  35. Vikas Vikas

    Superb work prem!!. This post help me a lot in understanding rule availability concept .

    Can you please post on Case Management?

    • Premkumar G Premkumar G

      Thank you so much, Vikas. 🙂
      Yeah, many people have asked me for that post. I’ll post about that soon. 🙂

  36. Haranadha reddy Haranadha reddy

    excellent presentation Sir… Please share more ..

    • Premkumar G Premkumar G

      Thank you so much, Haranadha. 🙂
      I’ll post more number of posts for sure. Stay tuned. 🙂

  37. rajasekhar rajasekhar

    Its great work prem…

    • Premkumar G Premkumar G

      Thank you so much, Rajasekhar. 🙂

  38. Archana Archana

    Excellent Explanation with best Examples, I never see such explanation before, I am Pega beginner can able to understand now.
    Thanks for the Posts.

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Archana. 🙂
      Glad to hear that you are finding it useful. 🙂
      You are most welcome. 🙂

  39. Vishnu Vardhan Vishnu Vardhan

    Perfect, very well explained 🙂

    • Premkumar G Premkumar G

      Thank you so much, Vishnu Vardhan. 🙂

  40. Manish Manikyarao Manish Manikyarao

    Hi Prem.. Great Job 🙂

    I have activity ABC define in Ruleset A and Ruleset B.
    No blocking the activity ABC in Ruleset A. During run time will it pick activity ABC defined in ruleset B ?

    Thanks in Advance 🙂

    • Premkumar G Premkumar G

      Hi Manish,
      This is very simple. It is based on ruleset assembly.
      If Ruleset A comes over Ruleset B, then at runtime It will throw blocking error.
      If ruleset B comes over ruleset A, then at runtime it runs without error.

      Blocking is always version dependent.

  41. Prasad Prasad

    Bro, really nice..

    • Premkumar G Premkumar G

      Thank you so much, Prasad. 🙂

  42. Siva Siva

    Hi Prem nice job 🙂

    can you please provide me full information about Activities.

    • Premkumar G Premkumar G

      Hi Siva,
      Thank you. 🙂
      I’ll post about it soon. Stay tuned. 🙂

  43. Ajay Ajay

    Hi Prem,
    I am new to Pega and looking for opportunity in Pega. I referred may material on youtube. they are not as useful as you content. These are really helping me as well as people like me to understand Pega.
    Thanks

    • Premkumar G Premkumar G

      Hi Ajay,
      Thank you so much for your appreciation. I’m so much glad that my posts helped you a lot.
      You are most welcome. 🙂

  44. Paramaguru Paramaguru

    HI Prem,

    This is really helpful for the beginner , awesome explanation . I appreciate and thanks for the write ups.

    Thanks
    Param.

    • Premkumar G Premkumar G

      Hi Paramaguru,

      Thank you so much for your appreciation. You are welcome. 🙂

      Regards,
      Premkumar G

  45. Vidyasagar Vidyasagar

    Beautifully explained ! Thanks.

    • Premkumar G Premkumar G

      Thank you so much, Vidyasagar and you are welcome. 🙂

  46. Nikhil Nikhil

    The way you have explained , it becomes so easy to understand.
    Please keep on posting:)

    • Premkumar G Premkumar G

      Thank you so much Nikhil. 🙂
      Yeah, I’ll keep on posting new stuffs. 🙂 Stay tuned.

  47. sagar sagar

    Superb Explanation Thanks

    • Premkumar G Premkumar G

      Thank you for your appreciation and you are most welcome, Sagar. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!