LogoLogo
User DocsAPI Docsatfinity.swiss
  • 🚀Atfinity: No-Code Process Automation
  • Guides
    • Getting Started
      • Introduction
      • 1. Create Ontologies and Roles
      • 2. Create Information
      • 3. Create and Configure a Document
      • 4. Create a Rule
      • 5. Create a Process
      • 6. Put Live
      • Summary and Next Steps
    • Advanced Topics
      • Extending a Workflow
      • Customizing Names of Cases and Instances
      • Automatically Calculating Information Values
      • Using Built in Integrations
    • Troubleshooting
      • Why is a question not asked?
      • Why is a question asked?
      • The value of my calculated field has a strange format
      • Why is my Proof never asked for?
      • Why is my Rule not executed?
      • Why are some options missing in a dropdown?
      • Case Errors
    • Glossary
      • Case
      • Process
      • Workflow
      • Ontology
      • Instance
      • Role
      • Information
      • Document
      • Document Section
      • Document Template
      • Rules
      • Scheduled Rules
      • Information Types
      • Tab
      • Category
      • Taxonomy
      • Proof
      • RuLa Functions
      • Constants
  • Rule Language (RuLA)
    • ℹ️What is RuLa?
    • Declarations
      • is
      • is with where
      • is all
      • is all with min max
      • Role Choices
    • Expressions
    • Operators
      • Boolean Operators
        • =
        • !=
        • >
        • >=
        • <
        • <=
        • and
        • and then
        • not
        • or
        • or else
        • matches (~=)
      • Date Operators
        • NOW
        • IS_DATE
        • TODAY
        • FORMAT_DATE
        • DAYS
        • WEEKDAYS
        • ADD_DAYS
        • ADD_WEEKDAYS
        • ADD_MONTH
        • ADD_YEARS
        • SUBTRACT_YEARS
        • AFTER
        • DATE_EQUAL
        • DATETIME_EQUAL
        • AFTER_EQUAL
        • BEFORE
        • BEFORE_EQUAL
        • DAYS_AGO
        • MONTHS_AGO
        • YEARS_AGO
      • Known Operators
        • unknown
        • known
        • SNEAKY
        • AVG_OF_ANY
        • LIST_OF_ANY
        • MAX_OF_ANY
        • MIN_OF_ANY
        • SUM_OF_ANY
        • CONCAT_OF_ANY
        • UNION_OF_ANY
        • JOIN_OF_ANY
      • List Operators
        • [ , ] (create)
        • [] (access)
        • in
        • not in
        • contains
        • contains any
        • contains only
        • COUNT
        • SORT
        • CUSTOM_MAX
        • REVERSE
        • FIRST_ELEMENT
        • ALL
        • SOME
        • UNION (or |)
        • SET_DIFFERENCE
        • INTERSECTION
        • MAP
        • FILTER
        • FILTER_FALSE
        • FILTER_UNKNOWN
        • SET
      • Dictionary Operators
        • {} (create)
        • [] (access)
        • in
        • keys()
        • FLATTEN
      • Mathematical Operators
        • + - / *
        • %
        • **
        • //
        • AVG
        • CEIL
        • FLOOR
        • MAX
        • MIN
        • ROUND
        • SUM
        • SUM_PRODUCT
        • SQRT
      • String Operators
        • LEN
        • LOWER
        • UPPER
        • TRIM
        • TRIM_LEFT
        • LEFT
        • RIGHT
        • SLICE
        • REPLACE
        • REPLACE_CHARS
        • format
        • calculated_name
        • CONCAT
        • markdown_table
        • make_filename
        • JOIN
        • uuid
      • Special Operators
        • :=
        • ensure
        • get_attr
        • get_translated_attr
        • has_attr
        • get_properties
        • instances
        • instances_exist
        • is
        • ontology
        • Translate (.$)
        • translate_string
        • roles
        • self
        • name_and_log (debug)
    • Conditional Expressions
      • case
      • if-then-else
      • switch
    • Comments
    • Information about the case
    • Accessing the outcome instance
    • Information about documents
    • Recipes
  • Document XML (ADX)
    • ℹ️What is ADX?
    • ADX Elements
      • Body
      • Text
      • Image
      • Columns
      • Field
      • Checkbox
      • Table
      • Rect
      • Line
      • Space
      • KeepTogether
      • Template
      • Style
      • Page Number
      • QR Code
      • HR Code
    • Jinja Templating
      • Instances
      • Case Meta Information
      • Custom Translations
      • Functions
      • Jinja filters
    • Font support
  • API
    • ℹ️What is the Atfinity API?
    • Generate API Keys
    • API Documentation
    • Calling your APIs within Cases
    • External Data Sources (e.g. CRM)
  • Deploying
    • Deploying on-site
      • Kubernetes
      • Docker Compose
    • Management commands
    • Security Logging
    • LDAP User Backend
    • Single Sign On
  • Integrations
    • Avaloq
    • Worldcheck
  • Releases
    • Release Notes
      • Version 11.x
      • Version 10.x
      • Version 9.x and earlier
    • Release Schedule
Powered by GitBook
On this page
  • Example: Explaining why a rule is there
  • Example: Explain a complicated part
  • Example: Comment-out a rule part temporarily

Was this helpful?

  1. Rule Language (RuLA)

Comments

PreviousswitchNextInformation about the case

Last updated 2 years ago

Was this helpful?

Comments are lines you write in a , which the system will ignore.

They have no impact on how a condition is evaluated, how a value is assigned, what the next step in the should be, etcetera.

Adding comments to rules is a way to:

  1. Explain why a rule exists.

  2. Explain a particularly complicated part of a rule.

  3. ‘Comment-out’ part of a rule, meaning the system will ignore it.

You turn a line into a comment by putting a hashtag # at the start of it.

Each line that contains (part of) a comment has to start with #. If your comment is an explanatory sentence that runs over multiple lines, add a # at the beginning of each of those lines.

Example: Explaining why a rule is there

# According to regulation, only people living in Switzerland 
# need to fill out this document.
p is Person
p.domicile = ch 

atfinity completely ignores the first two lines that start with # and only acts on the last two lines.

The first two are a comment, explaining to other rule designers why the rule exists.

In this example, the reason for the rule is pretty self-explanatory and not really in need of a comment. However, with more surprising rules, this type of comment can be very helpful.

Example: Explain a complicated part

p is Person
# The sum of percentages from all sources of wealth needs to be exactly 100.
SUM([
	(if allowance in p.sources_of_wealth then p.percentage_allowance else 0 end), 
	(if inheritance in p.sources_of_wealth then p.percentage_inheritance else 0 end),
	(if lotteries in p.sources_of_wealth then p.percentage_lotteries else 0 end),
]) != 100

You want to know all sources of a person’s wealth. There cannot be an unaccounted for 5 percent. That means the percentage values of the various sources have to add up to exactly 100.

The rule in the example above ensures that an issue will be raised if the sum of all percentages is anything else than 100. Because the SUM part of the rule is a bit complicated, we added a comment line, explaining our reasoning.

Example: Comment-out a rule part temporarily

p is Person
# p.domicile = CHE

In this example, p.domicile = CHE is preceded by a #, meaning it is commented-out and therefore ignored by the rule engine. While we are designing our processes and rules, this can be a powerful tool to figure out why a rule is or is not executed.

rule
process