Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ module.exports = config({
children: [
['applications/modules/bootstrap/tags', 'Tags'],
['applications/modules/bootstrap/dynamic-attributes', 'Dynamic Attributes'],
{
title: 'Data',
collapsable: true,
children: [
['applications/modules/bootstrap/data/general', 'General'],
['applications/modules/bootstrap/data/data-checks', 'Checks'],
['applications/modules/bootstrap/data/data-transformations', 'Transformations']
]
}
]
},
['preparing-content', 'Commerce Start'],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: Data Check Rules
tagline: Define and execute validation rules to identify incorrect or incomplete records.
author: David Wasserbauer
---

## Introduction

Data Check Rules allow administrators to identify records that do not comply with expected data quality criteria. Each rule specifies a target entity, a query to identify records of interest, and an optional condition for advanced validation logic.

When a rule is executed, it generates a set of log records representing failed validations. These logs can be reviewed, manually resolved, or serve as the basis for further automated actions.

![Data Check Rule Form](/.attachments/applications/modules/bootstrap/data/data-check-rule-form.png)

## Entity Definitions

### Data Check Rule (`talxis_datacheckrule`)

| Display Name | Logical Name | Description |
| -------------------- | -------------------- | ---------------------------------------------------------------------------- |
| Name | `talxis_name` | Name of the rule, typically includes its purpose or target field. |
| Entity Name | `talxis_entityname` | Logical name of the entity to which the rule applies. |
| Filter Query | `talxis_query` | FetchXML query identifying relevant records. |
| Condition (Function) | `talxis_conditionid` | Optional reference to a PowerFx-based function used for more advanced logic. |
| Description | `talxis_description` | Optional explanation of what the rule validates or checks. |

### Data Check Log (`talxis_datachecklog`)

| Display Name | Logical Name | Description |
| ---------------------- | ---------------------------- | -------------------------------------------------------------- |
| Data Record | `talxis_datarecordid` | Polymorphic lookup to the affected record. |
| Data Check Rule | `talxis_ruleid` | Reference to the rule that created this log. |
| Status (Reason) | `statuscode` | Current processing status (see table below). |

## Status Values

| Code | Status Name | Meaning |
| --------- | --------------- | ------------------------------------------------------ |
| 742070000 | Evaluation | Awaiting result of condition evaluation. |
| 742070001 | Pending | Condition passed or not defined, needs user attention. |
| 742070002 | Checked | Confirmed by user, optionally after manual correction. |
| 742070003 | Cancelled | Condition evaluated to false. |
| 742070004 | Error | Error occurred during evaluation. |

## Rule Execution

Rules can be triggered in two ways:

### 1. Automatically

* As part of a broader processing pipeline (e.g., after data import).
* System filters rules by entity name and runs them on newly imported data.

> ⚠️ This applies only to Albert VAT App. See [User Guide](https://thenetworg.sharepoint.com/:w:/r/teams/pct20004/Shared%20Documents/General/_DOCS/250509-DC-01%20VAT%20App%20-%20User%20Guide.docx?d=w621b4d97c59f40be860062708c44bbd1&csf=1&web=1&e=NfOERk) to get more info.

### 2. Manually

* Rules can be run on demand from the admin UI.
* The "Run Rule" button is available in the grid view of active rules.

Each rule execution creates one or more log entries in `talxis_datachecklog`, depending on the number of matching records.

## PowerFx Conditions

Rules may include an optional condition defined in a PowerFx-based Custom API (a Function). This enables scenarios that FetchXML cannot support, such as:

* Calculations
* Multi-entity logic
* Value comparisons

### Requirements

* Input: `RecordId` (string)
* Output: `Result` (boolean)

Example function body:

```plaintext
{
Result:
LookUp('Invoice Lines','Line ID' = GUID(RecordId)).Amount > 1000
}
```

If the condition returns `true`, a log entry is marked for review.

If `false`, the `statuscode` is set to `cancelled`.

## Manual Resolution

Users can resolve check logs via the following options:

* **Mark as Checked**: Indicates that the data is acceptable despite the check failure.
* **Perform Correction**: Launches a dialog to apply a correction directly to the source record. This creates a related Data Transformation Log.

## Related Plugins

* **ValidateCustomApiCondition** – When a check rule includes a condition, this plugin executes the corresponding Function and updates the log status.

## Automation Integration

Data Check Rules can be used as part of larger workflows. Typical integration points include:

* Post-import validation
* Pre-submission data quality assurance
* Audit trail creation

Each check log entry provides a clear indication of where data failed to meet defined criteria, enabling both reactive and preventive data governance.
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
title: Data Transformation Steps
tagline: Define and execute rules that correct values in target records.
author: David Wasserbauer
---

## Introduction

Data Transformation Steps provide a structured mechanism for correcting data in target records.

Each step defines which records to modify, which field to update, and what new value to apply. Execution results are logged for full auditability.

![Data Transformation Step Form](/.attachments/applications/modules/bootstrap/data/data-transformation-step-form.png)

## Entity Definitions

### Data Transformation Step (`talxis_datatransformationstep`)

| Display Name | Logical Name | Description |
| ----------------------------| --------------------------| ----------------------------------------------------------|
| Name | `talxis_name` | Descriptive name of the transformation step. |
| Entity Name | `talxis_entityname` | Logical name of the entity being transformed. |
| Target Field | `talxis_attributename` | Field name to update (logical name). |
| Step Number | `talxis_stepnumber` | Execution order; lower numbers are processed first. |
| Filter Query | `talxis_query` | FetchXML to select records for update. |
| Condition (Function) | `talxis_conditionid` | Optional PowerFx condition. |
| Transformation (Function) | `talxis_transformationid` | PowerFx function that computes the applies new value. |
| Description | `talxis_description` | Optional explanation of what the step does. |

### Data Transformation Log (`talxis_datatransformationlog`)

| Display Name | Logical Name | Description |
| ----------------------- | -------------------------------------- | -------------------------------------------------------------|
| Data | `talxis_datarecordid` | Polymorphic reference to the target record. |
| Transformation Step | `talxis_stepid` | Reference to the originating step. |
| Original Value | `talxis_originalvalue` | Value before the transformation. |
| New Value | `talxis_newvalue` | Value after the transformation. |
| Type (Manual/Automatic) | `talxis_datatransformationlogtypecode` | Indicates how the change was triggered. |
| Reason Description | `talxis_reasondescription` | Used to capture the reason for manual transformations. |
| Error Message | `talxis_errormessage` | Stores error messages generated during custom API execution. |
| Status | `statuscode` | Processing result (see below). |

## Status Values

| Code | Status Name | Meaning |
| --------- | -----------------------| ---------------------------- |
| 742070000 | Evaluation | Condition pending. |
| 742070001 | Waiting for processing | Ready for execution. |
| 742070002 | Processed | Change applied successfully. |
| 742070003 | Cancelled | Condition returned false. |
| 742070004 | Error | Error during execution. |

## Execution Flow

### Step Ordering

Each transformation step includes a `Step Number` that defines its place in the execution sequence. The system:

1. Sorts steps by this number (ascending)
2. Waits for all steps with lower numbers to finish before running the next group

The flow `talxis_waitforpreviousinstancesandlogsfinished` handles this sequencing.

> ⚠️ This applies when multiple steps are executed at the same time.

### Automatic Execution

Triggered after data import or other orchestration points, the steps run:

* Based on their target entity (matched against the import type)
* Only if their FetchXML query returns results
* Conditionally, if a Function is defined

> ⚠️ This applies only to Albert VAT App. See [User Guide](https://thenetworg.sharepoint.com/:w:/r/teams/pct20004/Shared%20Documents/General/_DOCS/250509-DC-01%20VAT%20App%20-%20User%20Guide.docx?d=w621b4d97c59f40be860062708c44bbd1&csf=1&web=1&e=NfOERk) to get more info.

### Manual Execution

From the admin interface, a user can trigger a specific step using the **Execute Step** button. The system will:

* Evaluate FetchXML
* Create logs for eligible records
* Evaluate condition (if present)
* Run the plugin to apply the change

## PowerFx Conditions

Used to determine whether a record qualifies for update. Function requirements:

* Input: `RecordId` (string)
* Output: `Result` (boolean)

Example:

```plaintext
{
Result:
LookUp('Invoice Lines','Line ID' = GUID(RecordId)).Country = "CZ"
}
```

## PowerFx Value Computation

In contrast to checks, transformations can also compute the actual value to be applied. A dedicated PowerFx function returns:

* Input: `RecordId`
* Output: `NewValue` (string)

Example:

```plaintext
{
NewValue:
Text(
Patch(
'Invoice Lines',
LookUp('Invoice Lines', 'Line ID' = GUID(RecordId)),
{ Country: "DE" }
).Country
)
}
```

## Manual Corrections via Dialog

Manual corrections allow users to:

* Select a field to update (validated for writability)
* Enter a new value based on data type
* Confirm the change

This creates a `talxis_datatransformationlog` with:

* Type: Manual
* Step: *(not linked to any step)*

Plugin `ResolveDataTransformationLog` applies the change based on the new value.

## Related Plugins

* **ResolveDataTransformationLog** – Applies the new value to the record based on the transformation log.

## Automation Integration

Transformation steps are typically triggered as part of a post-import process, but may also run independently. Each step provides:

* Controlled correction mechanism
* Traceable log per change
* Flexible logic with conditions and value computation
Loading