Working With Data Scanners
You can define Data Scanner Rules for fields of the objects for which you configure Data Scanners by grouping rules and using logical operators (AND, OR) to connect them. To specify the records to which the rule should be applied, you can also define Data Scan Filters. Additionally, you can define Data Scanner Rules for fields of the target objects of Relationship fields. The maximum depth of these relationships is 3.
Data Scanner Rules
Newly created Data Scanner records are inactive by default, and cannot be used to scan records until they are activated. Before you activate Data Scanners, you must define Data Scanner Rules. After Data Scanners are activated, Data Scanner Rules cannot be edited, and scans are automatically triggered when records are created, updated, or deleted. You can then manually trigger a data scan, or configure a System Job to trigger full scans at specified time intervals.
Data Scan Filters
To specify the records to which to apply Data Scanner Rules, you can define Data Scan Filters. For example, if you define a Data Scanner Rule which returns only records that have a Start field value of up to 30 minutes from the current time, you can define a filter to apply the rule only to Event records with a Priority field value of High.
* 
To make the objects for which you want to create Data Scanners available to configure in Data Scanner Rules and Data Scan Filters, you must first update the Scan Enabled option in the related Object records.
Additionally, you can use only the Field records in which the Indexed option is enabled to define Data Scanner Rules.
Scan Results
You can make scan results visible by linking the Captured by Data Scanner field to the object for which scans are triggered. This field is automatically selected when records violate Data Scanner Rules, which makes the records in violation visible in scan results. After you link this field, a multiple Relationship with the name <Object Name> Data Scanners is automatically created, for example, Event Data Scanners. The Source Object field is used to specify the object to be scanned, and the Target Object field is used to specify the Data Scanner object. Additionally, when you link this field, the Captured by Data Scanner Updated On field, which is populated with the time of the most recent update to the Captured by Data Scanner field, is automatically linked to the same object. After these fields are configured, Captured by Data Scanner field values are selected in cases where records are in violation of at least one Data Scanner Rule to provide users with visible indications of violations.
Post Actions
Data Scanners also support Post Actions, which are object-level and Data Scanner-level Operations that are executed after both full and automatic data scans are successfully completed. Object-level Post Actions are executed first, followed by Data Scanner-level Post Actions, and use the following parameters.
Name
Class
Description
matched
java.util.List
Elements: java.util.UUID
IDs of records in violation of the rule
notMatched
IDs of records not in violation of the rule
objectDef
com.intalio.core.seed.api.IEntityManagerDefinition
Definition of object whose records were scanned
dataScannerId
java.util.UUID
Data Scanner record ID
scanMode
com.servicemax.core.seed.internal.datascan.DataScanMode
DataScanMode.full, DataScanMode.onTheFly, or DataScanMode.ruleDisabled
triggeredBy
java.util.UUID
User ID that triggered the data scan
Groovy Source Code Example
import com.intalio.core.seed.api.IEntityManagerDefinition
import com.servicemax.core.Database
import com.servicemax.core.seed.internal.datascan.DataScanMode

class CustomPostAction {
public Object execute(Map params) {
List matchedRecordIds = params['matched']
List notMatchedRecordIds = params['notMatched']
UUID dataScannerId = params['dataScannerId']
DataScanMode scanMode = params['scanMode']
UUID triggeredByUser = params['triggeredBy']
IEntityManagerDefinition relatedObject = params['objectDef']
List matchedRecords = Database.queryAsList("SELECT * FROM ${relatedObject.getFullIdentifier()} WHERE io_uuid IN :matchedIds", [matchedIds: matchedRecordIds])
List notMatchedRecords = Database.queryAsList("SELECT * FROM ${relatedObject.getFullIdentifier()} WHERE io_uuid IN :notMatchedIds", [notMatchedIds: notMatchedRecordIds])
... // do the rest work with the records.
}
}
When you link users, groups, or roles to Data Scanner records as subscribers, email notifications are sent to users who trigger full scans after success or failure. Linked users and users related to the linked groups and roles are also notified.
* 
Email notifications are sent only to users with related User records in which the Authenticated and Active check boxes are selected.
Email addresses are retrieved from the Email field in User Contact records.
Email & Notifications must be enabled in the active System Setting record.
The Data Scan Completed record of the Email Notification Request object must be activated. Email templates are defined in this record, which you can update per your requirements.
Limitations
Data Scanners in Max Platform applications have the following limitations on concurrent processing and the number of Data Scanners that can be configured per object:
Multiple Data Scanners for a single object cannot run concurrently. When a Data Scanner configured for a specific object is running, and another Data Scanner configured for the same object is triggered, the newly triggered Data Scanner is placed in a queue and is triggered after the current execution is complete. This limitation applies to Data Scanners that are triggered manually or automatically by System Jobs, but does not impact automatic scans triggered by record updates.
The number of Data Scanners for multiple objects that can run concurrently is configured in the Maximum Concurrently Processing Data Scanners field in the active System Setting record. When the number of currently running Data Scanners reaches this limit, newly triggered Data Scanners are placed in a queue and triggered after the number of current executions falls below the configured maximum. This limitation applies to Data Scanners that are triggered manually or automatically by System Jobs, but does not impact automatic scans triggered by record updates.
By default, a maximum of 10 active Data Scanner records can be configured per object. When the number of active Data Scanners records configured for an object reaches this limit, no additional active Data Scanner records can be created, activated, or undeleted. Therefore, to create, activate, or undelete additional active Data Scanner records, existing active Data Scanner records must be deactivated or deleted. Alternatively, new Data Scanner Rules can be added to existing Data Scanner records. This maximum limit is configured in the Maximum Active Data Scanners Per Object field of the active System Setting record. When this field value is updated, existing active Data Scanner records are not affected and their behavior remains unchanged.
Was this helpful?