Skip to content

CASE

From RuLa, you can access certain information about the case itself. For this, within applicable rules, you have access to the constant CASE like to any other instance. On this instance, the following information is available:

PropertyDescription
PropertyDescription
CASE.case_numberThe case number in the user readable format, e.g. CSE-1991.
CASE.process_keyThe key of the process the case is based on, e.g. end_to_end_onboarding.
CASE.process_nameThe translated name of the process the case is based on, e.g. End to End Onboarding.

Note: This will be translated on documents and in the case manager. Within rules, it's just a placeholder, so e.g. `CASE.process_name = 'Onboarding'` will not work. Use process_key for such comparisons.
CASE.outcome_instanceThe outcome instance this case operates on. For a case creating a new contract this is often ContractualRelationship.
CASE.stateThe key of the current state the case is in, e.g. draft.
CASE.all_statesAll possible states the case could be in according to the workflow of the process.
CASE.states_history

Returns a dictionary with some statistical information about each state. This includes:

  • initiator (the last one)
  • entered (when was this state entered last)
  • days (Total days in state, so the time in days the case was in this state every time it entered)
  • times_entered (how many times the case entered this state)
  • previous_state (the last one)
CASE.last_transitionThe key of the last transition (if any) that was done to arrive at the current state, e.g. back_to_draft.
CASE.last_transition_atThe time when the last transition (if any) happened, e.g. 2022-11-17 11:05:30.322951
CASE.last_transition_byThe username of the user that performed the last transition
CASE.last_transition_by_nameThe name of the user that performed the last transition
CASE.number_of_missing_informationHow many information still should be provided (the sum of all the grey bubbles on information tabs).
CASE.number_of_tasksCurrent number of tasks within the case.
CASE.number_of_issuesCurrent number of issues within the case.
CASE.created_atThe time when the case was created, e.g. 2021-11-30 16:40:12.923654
CASE.last_updateThe last time the case was updates, e.g. 2021-03-12 11:58:08.644664.
CASE.ownerThe owner of the case (the email in rules and the full name and email when printed)
CASE.owner_nameThe full name of the case owner
CASE.owner_groupsA list of the names of the groups the current case owner has.
CASE.owner_rolesA list of the names of the roles the current case owner has.
CASE.initiatorThe initiator of the case (the email in rules and the full name and email when printed)
CASE.initiator_nameThe full name of the case initiator
CASE.assigneeThe assignee to the case (the email in rules and the full name and email when printed)
CASE.assignee_nameThe full name of the case owner
CASE.approverThe user (if any) who approved the case (the email in rules and the full name and email when printed)
CASE.approver_nameThe full name of the case approver
CASE.documentsA list with the names of all documents that are used in a case. This can be used to e.g. create a customised table of contents.
CASE.proofsA list with the names of all proofs that are used in a case. This can be used to e.g. create a customised table of contents.
CASE.comments

A list of dictionaries about all the comments in a case. Each dictionaries contains these keys:

  • creation_date - ISO 8601 timestamp when the comment was created (string or null)
  • edit_date - ISO 8601 timestamp when the comment was last edited (string or null)
  • author - Name of the user who created the comment (string or null)
  • assignee - Name of the user assigned to the comment/task (string or null)
  • text - The comment text content (string or null)
  • is_issue - Whether the comment is marked as an issue (boolean)
  • is_resolved - Whether the issue has been resolved (boolean)
  • resolved_by - Name of the user who resolved the issue (string or null)
  • is_archived - Whether the comment is archived (boolean)
  • archived_by - Name of the user who archived the comment (string or null)
  • deadline - ISO 8601 timestamp for the task deadline (string or null)
  • referenced_instance - ID of the instance the comment refers to (integer or null)
  • referenced_information_key - Key of the information field the comment refers to (string or null)
  • referenced_readable - Human-readable reference, e.g., "Person 66" or "John Doe / street_and_number" (string or null)
  • is_warning - Whether the comment is a warning (boolean)
  • title - Title of the comment, if from a rule with a title translation (string, optional)
  • replies - List of reply comment dictionaries with the same structure (array, only present if comment has replies)
CASE.num_active_wizards (new in Atfinity 17)The number of wizards on the case that a user can still fill in and submit, i.e. those in status created or opened.
CASE.wizards (new in Atfinity 17)

A list of dictionaries about all wizards on the case, in any status. Each dictionary contains these keys:

  • status - The wizard status: created, opened, completed or inactive (string)
  • type - The wizard type: creation, ongoing_instances or ongoing_whole_case (string)
  • created - ISO 8601 timestamp when the wizard was created (string)
  • updated - ISO 8601 timestamp when the wizard was last updated (string)
  • wizard_template_uuid - The external UUID of the wizard template the wizard is based on (string or null)
  • email - The email address the wizard was created for (string)
  • opened_on - ISO 8601 timestamp when the wizard was first opened (string or null)

Example: CASE.number_of_issues

CASE.number_of_issues = 0 and CASE.number_of_tasks = 0

This rule will only be fulfilled when there are no issues or tasks within a case.

Example: CASE.state

CASE.state = 'draft'

This rule would only be fulfilled while the case is in the state with the key '"draft".

Please note that if you are using this to create an issue or comment, it would be, as any other issue, comment or warning, removed when the case leaves that state (unless a user replied to it or was assigned to it).

Example: CASE.num_active_wizards

CASE.num_active_wizards = 0

This rule is only fulfilled when there are no wizards left that a user can still fill in and submit.

Example: CASE.wizards

You can use CASE.wizards together with the list operators to reason about individual wizards, for example counting the wizards that have already been submitted:

count(CASE.wizards.filter(wizard => wizard.status = 'completed'))