Business Rules

A business rule transforms existing data.

Who can use this feature?

Users can view the Rules room with this profile:

  • Data Engineer or Data: Read (access level), Detailed (view level)

Users can create and configure rules with this profile:

  • Data Engineer or Data: Write (access level), Detailed (view level)

Users can preview rules with this profile:

  • Data Engineer or Data: Read (access level), Detailed (view level)
  • Internal Debugging additional capability

Additionally, users must have full data access to preview rules, such as Super Admin Permission. For more information, see Super Admin Permission.

Not sure if you have this feature or capability? Reach out to your administrator.

Overview

You can use business rules to add, remove, or edit data in your event stream. This prepares the data for use in Visier.

Note: The event stream is a set of stages that represents your data in Visier throughout the process of applying rules to the data. When debugging data issues, you can look at the event stream to view data after each stage. For more information, see Event stream stages.

Business rules transform subject data in Visier. For example, you can write business rules for the Employee subject to transform your employee data before the data becomes visible to users. Each business rule defines logic that is applied to one member of a subject at a time.

Example: If an employee experiences an increase in pay level, add a promotion event.

Copy
when changeIn(Pay_Level) and (currentValueOf(Pay_Level) > previousValueOf(Pay_Level))
    add Promotion(Promotion_Reason := "Pay Level Increase")

This rule states that whenever a change to the Pay_Level property happens on the Employee subject and the current value of the Pay_Level property is greater than the previous Pay_Level value, add a Promotion event with the Promotion_Reason property set to "Pay Level Increase".

Create a business rule

  1. In a project, on the navigation bar, click Data > Rules > Business Rules.
  2. Click Create Rule.
  3. Select the data category that the rule belongs to. For more information, see Data Categories.
  4. Select Business rule.
  5. Type a display name and description.
  6. Select the subject that the rule applies to.
  7. Optional: In Formula, type the business rule formula. If you aren't ready to add the formula, you can add the formula after creating the rule. For more information, see Visier Business Rule Language (VBRL).
  8. When finished, click Done.

Configure an existing business rule

  1. In a project, on the navigation bar, click Data > Rules > Business Rules.
  2. In Data category, select the appropriate data category.
  3. Optional: To change the order of the rules, click the Reorder button and then, in the Reorder business rules dialog, click and drag a rule to reorder it. When finished, click Done.
  4. Select a rule from the list.

    Note: If you hover over a rule, you do the following actions:

    • Add to custom content export: Add the rule to the list of custom content available for export. For more information about the custom content export, see Export Custom Content.
    • Delete: Delete the rule.
  5. Do any of the following:
    • Enable or disable the rule. By default, new rules are enabled. If enabled, the rule is active and will run against the subject's data during data load jobs.
    • To change the subject that the rule is applied to, in Subject, select a new subject.
    • In the formula editor, write or change the rule's formula. The formula defines the transformations to make to the data. When finished, click Validate.

      Note: To learn how to write a business rule formula, explore the Formula dictionary below the formula editor.

    • When finished, click Preview. You can use the business rule preview tool to validate your rule against real data without generating a new data version. For more information, see Preview the business rule below.
  6. When finished, publish your project to production. For instructions, see Publish Project Changes.

Preview the business rule

Business rule preview is a tool used to check the output of a new or modified business rule without having to run a new data version, which greatly reduces time spent during business rule authoring.

Note: Before creating a new business rule or modifying an existing rule, make sure you run a data version with one of the following Generate debugging info settings:

  • For stages and records
  • For stages, records, and rules

For more information about Generate debugging info, see Schedule a Job.

Business rules are run on an event stream sample that exist per subject. Event stream samples can be edited. Most of the time, the sample should be imported from debug inspector partitions.

To access business rule preview:

  1. Open a project.
  2. Navigate to Data > Rules.
  3. Select a rule from the list.
  4. Click the Preview tab found below the rule formula.

The following image shows the different options that are available when setting up the business rule preview.

  1. Formula: The business rule formula.
  2. Validate: An action to check that the formula is valid.
  3. Event stream: A sample event stream to test the rule. The preview checks the event stream to see if the rule does anything, and shows what the rule will do. You must create an event stream before running the business rule preview tool. For more information, see Manage event streams.
  4. Data version for lookup streams: The data version that you want to pull lookup stream information from.
  5. Run previous rules: An optional action to run the rules preceding the selected business rule.
  6. Preview: An action to preview the business rule with the selected settings.

After selecting your business rule preview settings and clicking Preview, the table below will populate with information about the subject, including:

  • Event Type: The type of event that occurred. This can be Profile Change, Conception, Termination, or Regular. For more information, see Debug inspector columns.
  • Event Time: The date and time that the event occurred.
  • Record Period ID: The date and time that the record experienced an event.
  • SEQ #: If set during data extraction, this indicates the sequence number of the event.
  • Property Name: The object name of the property that experienced an event.
  • Value: The new value of the property.

Manage event streams

In the business rule preview, you can create test event streams to validate that the business rule is working as expected. Before you can use the business rule preview tool, you must first create an event stream through which to run the business rule. In the event stream, you can specify fake data or bad data to test the business rule.

You have the following options to add events to the test event stream:

  • Add event: This allows you to specify the event type, event date, and any properties associated with the event.
  • Import events: This allows you to use a specific data version, event stream stage and substage, and subject ID on which to run the business rule.

After you create an event stream and add or import events in the stream, you can then use the event stream in business rule preview. To use business rule preview, see Preview the business rule.

Create an event stream

  1. In a project, on the navigation bar, click Data > Rules > Business Rules.
  2. Select a rule from the list.
  3. Click Manage event streams > Create event stream.
  4. Optional: To change the event stream display name, click the More button > Edit, and then type a new display name and click Done.

    Result: The test event stream is created and ready to add or import events.

Add event

  1. In a project, on the navigation bar, click Data > Rules > Business Rules.
  2. Select a rule from the list.
  3. Click Manage event streams.
  4. Select the event stream in which you want to add a new event, and then click Add Event.
  5. In the Add event dialog, in Event type, select one of the following event types.
    • Profile Conception: Indicates the first time a profile exists for temporal data. Not applicable to transactional data.
    • Profile Termination: Indicates the first timestamp that a profile doesn't exist for temporal data. Not applicable to transactional data.
    • Profile Change: Indicates a change in an attribute. For example, an employee's last name.
    • Event: Indicates a change to a specific event. For example, a change to an employee's compensation payout.
  6. In Event date, set the date that the test event should occur.
  7. If Profile Change, select the property on which you want to test a change and then type the change value.
  8. Optional: To add additional events, select Add another event.
  9. When finished, click Add.

Import events

  1. In a project, on the navigation bar, click Data > Rules > Business Rules.
  2. Select a rule from the list.
  3. Click Manage event streams.
  4. Select the event stream in which you want to import events, and then click Import Events.
  5. In the Import events dialog, in Data version, select the data version in which to add the test events.
  6. In Stage, select the data pipeline stage in which to start the event stream from. For more information about stages, see Event stream stages.
  7. In Substage, select the substage to preview. Available if the data version was generated with debugging information for stages, rules, and records. For more information about generating debugging info, see Schedule a Job.
  8. In Subject ID, type the ID of the subject to test the business rule on.
  9. When finished, click Import.