A Beginners Look at Alfresco Visibility Rules
Alfresco Process Services (APS) with it’s App Designer offers a form tool that really gives meaning to the term “low code.” For power users or Citizen Developers, you can build a fully functioning and powerful form without having to write a single line of code. Part of that power comes from the Visibility Rules feature embedded within the form tool.
Often there will be business requirements that involve displaying or hiding certain form fields based on the conditions of one or more other fields on the form. For example, based on if a user selects YES to a question, the form should display fields A, B, C, and D. If they select NO to the same question, display fields E, F, and G. This is a very common requirement with forms and some BPM tools do not provide this option as a configurable function and requires some sort of coding to achieve what is needed.
Within the form tool in APS, a user can create these visibility rules quite easily once they understand how the tool works. Within the forms tool, each control placed on the form canvas has a property/tab called Visibility. In the screen shot below, we have a form with a Radio button control with rules applied to it for controlling when the field is displayed:
The radio button control will display only if the value in the Employee Type field is equal to “fulltime” or “parttime” otherwise it is invisible.
There are three components to configuring the condition:
These three factors are defined under the Configuration Tool within the Visibility properties tab. When you add a row to the Rule List, you configure that rule using the configuration tool:
1. Depends On
The “Depends On” section is the starting point for the rule. It refers to the form field or variable. For dynamic forms, you would base your visibility rule on a form field that potentially gets changed when the field is active. In the screen shot below, when you select Form Field, you have a drop down displaying all of the fields on the form. You select one to be your “Depends On” field.
You can also select Variable which provides the process level variables defined to “Depends On” Use this option mainly to initialize a form with key fields based on variables set within a workflow. This is a more advanced use of the visibility rules and would require some code or the use of a Decision Table outcome.
2. If it’s
The “If it’s” dropdown is a list of operators used in the condition for the form field or variable selected above. The values in the dropdown will change based on the type of field (i.e. for text fields, you will only see “equal” or “not equal.” If it’s a date field, you’ll have a variety of options like before or after the date value in the field or if it’s empty, not empty, etc. Number fields have less than, greater than, less than OR equal to, greater than OR equal to, etc.
At this point, our rule would be “Depends on Form Field X, if it’s Y, then …”
The Value is mainly a hard coded value typed into the configuration tool. For example, if the Depends On field was a dropdown, you would enter the ID or the label for the dropdown in this field. Unfortunately, the configuration is not smart enough to provide the values from the dropdown in this interface, so you will have to have those values written down before hand. If you use ID for the dropdown, that may be easier as long as your IDs are simple enough (i.e. if you had a Department dropdown, an option could be “Human Resources” as the label and “hr” as the ID…much easier to remember).
You can also use a Form Field value or a Variable to compare. I have not come across a situation where I would use a Form Field value to replicate here but I could see where that may happen. The variable would need to be a process variable that is set within the process maps which would require coding or the result of a decision table outcome.
4. Next condition operator
This final dropdown is not a required configuration and is only used when you need to string more than one rule together. Simply stated you could say that if a condition equals X OR a condition equals Y then set a value. This operator is also used for complex rules that require multiple conditions to get to a result (i.e the AND operator).
That’s the basics of setting up simple visibility rules in an APS Form. Even though these examples are the basics of the rules, they still provide quite a bit of dynamic value to the forms in your APS application. In future blogs, we’ll take a look at more advanced visibility rule configurations. For a more detailed look at what I have covered here, please check out our video from our Citizen Developer Series – APS Forms: The Basics or, for sign up for ClearCadence’s Citizen Developer Training Class: From Idea to Implementation by contacting us through the web site.
Kevin Beddingfield is Managing Director at ClearCadence (www.clearcadence.com) and heads up ClearBPM, a packaged service for companies to help gauge their BPM/BPA readiness in addition to doing full analysis, requirements documentation and functional design for a BPMS project from a software agnostic point of view.