Checking Validation of Program Rules across a system

Hi CoP. It’s come to my attention sporadically that my server has ill-formatted Program Rules lurking within expressions. Because of our size and vast evolution that we’ve undergone both to improve our programs and roll with version upgrades with new opportunities/different formatting preferences, it would not be surprising for me to hear that more Program Rules are faulty in our system. My question is:

Is there a way for me to look across a system for any invalid expressions that exist?

If there isn’t, I’m tempted to build something out with a series of API pulls and some kind of a crazy Excel that checks the PRVs. But ideally I could avoid that.

I was hoping that the Data Integrity Run might have something like this, however it never completes on our server. After a couple of hours it just errors out.

Thanks for any insights!!

@Gassim let me know if I can make this more clear or suggestions on who to reach out to for this. Thanks so much!

1 Like

You’re welcome! @Matthew_Boddie

Thanks so much please don’t hesitate to add more info. I’ve asked it as a general question to the support group but if we can be more specific then it’ll be helpful.

Hey @Pablo . I know we do something like this with Android. Maybe we could link here the part of the code that does this?

1 Like

That would be lovely @jaime.bosque & @Pablo will stay tuned!

1 Like

In the android we have a helper class that checks for problems in program rules. You can find the related code (in kotlin) here.

There are two steps:
1- Checks for errors when mapping the android SDK rule classes to the ones from the Rule Engine. This will return errors related to missing configurations. For example a hide section program rule with a null program stage section.
2- Evaluate every program rule and program rule action expression to check if the parser can handle it.

In the current app version (2.4) only the first step is evaluated. The second one is in the development branch but will be there for 2.4.1.
To access this checks from the app you need to use the training version from github.
Once installed follow these steps:

  • From the home screen, long click the menu icon in the top left corner of the screen. This will open the development options screen
  • Scroll to the bottom of the scree, there should be a program rules section there to run all evaluations.

@Pablo amazing. Very excited about this!

Currently when I Run Check I can see the button is depressed, but not seeing any action. How will I know its completed? Any output, or perhaps is “blank” output an indicator in itself? Thanks again!

@Matthew_Boddie while not generic for all possible Program Rules, this helper SQL query spots Program Rule Variables where the name contain any of (or/not/and) leading to mysteriously non-functional Program Rules on Android:


In the current implementation the blank output means everything should be ok. Once we move this checks to the settings screen the user will know exactly what is going on :wink:

1 Like

Thanks @dhuser ! I’m actually looking for a more general server check on program rules, but this is still very valuable. I haven’t actually experienced this mystery non-functional program rules, but good to know its something to watch out for!

1 Like

Great, thanks Pablo. Makes sense and seems like a very valuable tool!

I think I’m still going to work on building out something that can look at all prules in the system and give me a line-line pass/fail, so that I can report on validity of prules in general. (just as a side note, very sad that we lost the console page information of program rules that used to note each improperly formatted prule, and give information on why/where it broke down)

1 Like