Professional Documents
Culture Documents
Tips and tricks for how to make your task as an HFM rule programmer just a little easier
Dennis Jensen
Finance System Manager
Tools for rules
• Global engineering company supplying one source plants, systems and services
to the cement and minerals industries.
• 13,000 employees in more than 50 offices worldwide.
• Annual Revenue USD 3bn
• Founded in 1882
Dennis Jensen
• Finance background
• 9 years of HFM experience
Tools for rules
• Create your own powerpack for Notepad++, adding formatting capabilities such as expand/collapse blocks of
code, background colouring, etc.
• How to use UD’s and member lists to create custom lists for your rules coding, and make your rules
maintenance more simple
• OpenDataUnit, your best friend for limiting data processed by your rules code
• Create on/off switches that can be updated in a data form to enable activation/deactivation of validations,
etc., without changing rules
If you download it, it will be possible for you to run comparisons against both previous file and last save, for
easy review of your changes.
Tools for rules
Notepad++ (II)
No success in getting useful information from the built-in Rules Profiler in HFM.
But there are other options available for measuring time, using f.ex. date and time functions and WriteToFile.
Always comment out time measurement when not required, as it can have a large impact on performance.
Tools for rules
Measure time (II)
Matt Spencer, Finit, will give presentation about this solution in ”Campfire Stories”
Tools for rules
Measure time (III)
Can be used to build Member List for data selection, set destination in a rule, for Y/N triggers, etc.
This way you do not need to update rules when new Accounts are created, new Accounts are added to your
rules through the UD value in Metadata
Tools for rules
OpenDataUnit (I)
Comparing performance of DataUnit with a range of Accounts (on previous page), compared to setting the
DataUnit to be just one of the Accounts in the range:
The above example with 6,588 records is only a small percentage of the data records available, so if the
comparison was made against all data records the difference would be much larger.
See also ”Data-Driven Rules in HFM” (Keith Berry, KScope16) for more details about OpenDataUnit
Tools for rules
WriteToFile (I)
WriteToFile creates a text file, and it can be used for multiple purposes.
• Output for time measurement
• Output for checking No. of data records
• Rule debugging
• Etc.
The below example selects content for the text file to be generated.
Tools for rules
WriteToFile (II)
See also ”Where did that come from ?” (Chris Barbieri, KScope15) for more details about WriteToFile
Tools for rules
Use Variables and comments
Often stated, but important enough to justify repetition
Using comments to provide explanations and guidance is also a very good idea
Tools for rules
Create on/off switches (I)
On/off switches can be used in your rules code, allowing f.ex. validations to be activated or deactivated just by
entering a number on a data form.
In the below example, an Account has been set up for each validation, and each month a value is input to
determine if the validation is active or not for the period.
Tools for rules
Create on/off switches (II)
Only if the value entered is ”0” (for active), and the validation Account gives a value, then a lock will be placed
on the validation.
On/off switches are particularly beneficial where you want to activate or deactivate rules code without having
to load updated rules.
Setting the switches to be values to be input in data forms also means that users can activate or deactivate.
Tools for rules
Questions