AIWARNING
Name | AIWARNING |
---|---|
Description | Perform a validation, based on AI prompt. If the validation fails, a warning is sent. |
Parameter 1 | The AI prompt used to perform the validation. Usually, the AI prompt would be an interpolated string, interpolating the values, which should be validated in an AI prompt. It should return "true" if the validation is successful. Any other value (or timeout) would mean failure. |
Parameter 1 type | string - Constant, Formatted string or Interpolate |
Parameter 2 | The message, which should be provided to the user if the validation fails. The message might include the validated values using an interpolated (formatted) string parameter. |
Parameter 2 type | string - Constant, Formatted string or Interpolate |
Parameter 3 | Timeout, ms (optional) |
Parameter 3 type | Constant (integer) Default = 2000 ms. |
Examples | See the Example section below |
Version | Introduced in: 24 |
Compatible events chart
AIWARNING is compatible with all events.
Event type | Compatibility with AIWARNING |
---|---|
Client commit (e.g. CLIENTCOMMIT, AGGREGATECLIENTCOMMIT) | compatible |
Client committed (e.g. CLIENTCOMMITTED, AGGREGATECLIENTCOMMITTED) | compatible |
Document events - (e.g. STATECHANGING, STATECHANGED, VOIDING) | compatible |
Commit (e.g. COMMIT) | compatible |
Committed (e.g. COMMITTED) | compatible |
Front-end (e.g. CREATENEW, ATTRIBUTECHANGING, ATTRIBUTECHANGED) | compatible |
Example:
А business rule sends a warning when a party name doesn't look like a real one.
Repository | |||||||
---|---|---|---|---|---|---|---|
General.Contacts.Persons | |||||||
Events | |||||||
Event type | Event parameter | Execution priority | |||||
ATTRIBUTECHANGED | PartyName | Normal | |||||
Actions | |||||||
Action No | Action type | Parameter1 type | Parameter1 value | Parameter2 type | Parameter2 value | Parameter3 type (optional) | Parameter3 value |
1 | AIWARNING | Interpolate | Does this '{PartyName}' seem like a real name? | Interpolate | The provided name '{PartyName}' does not seem like a real one. | Constant | 10000 |
The parameters are as follows:
- Specifies that we're checking if the provided IBAN is valid.
- Specifies the error message to return if the validation fails.
- Specifies that there's a timeout of 2000 milliseconds.
Key points and specific limitations
- The results depend entirely on the AI engine and the specified prompt.
- With vaguer instructions, it's possible to receive different output for the same input.
- If the AI engine doesn't respond within the specified timeout, you will receive an empty string.