[
https://issues.apache.org/jira/browse/UNOMI-883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Serge Huber updated UNOMI-883:
------------------------------
Description:
h2. Description
This ticket is about implementing a unified approach to validate conditions
across different services to prevent invalid conditions from being stored and
ensure developer experience.
h3. Implementation Details
h4. Core Features
The new ConditionValidation class provides the following validation
capabilities:
*Parameter Types Support:*
* STRING
* INTEGER
* LONG
* FLOAT
* DOUBLE
* BOOLEAN
* DATE
* CONDITION
* OBJECT
*Validation Features:*
# Required Parameters
** Ability to mark parameters as mandatory
# Allowed Values
** Define a set of valid values for a parameter
# Condition Tags
** Specify allowed condition tags
** Filter conditions based on tags
# Condition Type Restrictions
** Define disallowed condition types
# Exclusive Parameters
** Support for mutually exclusive parameters
** Group exclusive parameters together
# Recommended Parameters
** Mark parameters as recommended but not required
# Custom Type Support
** Specify custom Java types for OBJECT parameters
h3. Example Condition Type Definition
{code:json}
{
"metadata": {
"id": "propertyCondition",
"name": "Property Condition",
"description": "Compares a property value"
},
"parameters": [
{
"name": "propertyName",
"type": "string",
"validation": {
"required": true
}
},
{
"name": "comparisonOperator",
"type": "string",
"validation": {
"required": true,
"allowedValues": ["equals", "notEquals", "greaterThan", "lessThan",
"exists", "missing"]
}
},
{
"name": "propertyValue",
"type": "string",
"validation": {
"recommended": true,
"exclusive": true,
"exclusiveGroup": "valueGroup"
}
}
]
}
{code}
h3. Service Integration
The validation service has been integrated with:
* SegmentService
* RulesService
* GoalsService
h3. Benefits
* Centralized validation logic
* Consistent validation across services
* Clear distinction between required and recommended parameters
* Support for complex parameter relationships
* Type safety through custom type validation
h2. Related Documentation
* API Documentation: ConditionValidation class
* Integration Examples: See SegmentServiceImpl, RulesServiceImpl, and
GoalsServiceImpl
* Test Cases: Validation scenarios in respective service tests
was:
{code:title=JIRA Ticket with Markup}
h1. Implement Unified Condition Validation Service for Enhanced Data Quality
and Error Prevention
h2. Overview
{panel:title=Metadata|borderStyle=solid|borderColor=#ccc|titleBGColor=#F0F0F0|bgColor=#FFFFFF}
*Type:* Feature/Improvement
*Priority:* High
*Components:* Core, API
*Labels:* validation, conditions, quality
{panel}
h2. Description
Apache Unomi has implemented a unified approach to validate conditions across
different services to prevent invalid conditions from being stored and ensure
data quality. This ticket documents the implementation of the centralized
condition validation service.
h3. Implementation Details
h4. Core Features
The ConditionValidation class provides the following validation capabilities:
*Parameter Types Support:*
* STRING
* INTEGER
* LONG
* FLOAT
* DOUBLE
* BOOLEAN
* DATE
* CONDITION
* OBJECT
*Validation Features:*
# Required Parameters
** Ability to mark parameters as mandatory
# Allowed Values
** Define a set of valid values for a parameter
# Condition Tags
** Specify allowed condition tags
** Filter conditions based on tags
# Condition Type Restrictions
** Define disallowed condition types
# Exclusive Parameters
** Support for mutually exclusive parameters
** Group exclusive parameters together
# Recommended Parameters
** Mark parameters as recommended but not required
# Custom Type Support
** Specify custom Java types for OBJECT parameters
h3. Example Condition Type Definition
{code:json}
{
"metadata": {
"id": "propertyCondition",
"name": "Property Condition",
"description": "Compares a property value"
},
"parameters": [
{
"name": "propertyName",
"type": "string",
"validation": {
"required": true
}
},
{
"name": "comparisonOperator",
"type": "string",
"validation": {
"required": true,
"allowedValues": ["equals", "notEquals", "greaterThan", "lessThan",
"exists", "missing"]
}
},
{
"name": "propertyValue",
"type": "string",
"validation": {
"recommended": true,
"exclusive": true,
"exclusiveGroup": "valueGroup"
}
}
]
}
{code}
h3. Service Integration
The validation service has been integrated with:
* SegmentService
* RulesService
* GoalsService
h3. Benefits
* Centralized validation logic
* Consistent validation across services
* Clear distinction between required and recommended parameters
* Support for complex parameter relationships
* Type safety through custom type validation
h2. Related Documentation
* API Documentation: ConditionValidation class
* Integration Examples: See SegmentServiceImpl, RulesServiceImpl, and
GoalsServiceImpl
* Test Cases: Validation scenarios in respective service tests
> Implement Unified Condition Validation Service for Enhanced Developer
> Experience and Error Prevention
> -----------------------------------------------------------------------------------------------------
>
> Key: UNOMI-883
> URL: https://issues.apache.org/jira/browse/UNOMI-883
> Project: Apache Unomi
> Issue Type: Sub-task
> Components: unomi(-core)
> Affects Versions: unomi-3.0.0
> Reporter: Serge Huber
> Priority: Major
> Fix For: unomi-3.0.0
>
>
> h2. Description
> This ticket is about implementing a unified approach to validate conditions
> across different services to prevent invalid conditions from being stored and
> ensure developer experience.
> h3. Implementation Details
> h4. Core Features
> The new ConditionValidation class provides the following validation
> capabilities:
> *Parameter Types Support:*
> * STRING
> * INTEGER
> * LONG
> * FLOAT
> * DOUBLE
> * BOOLEAN
> * DATE
> * CONDITION
> * OBJECT
> *Validation Features:*
> # Required Parameters
> ** Ability to mark parameters as mandatory
> # Allowed Values
> ** Define a set of valid values for a parameter
> # Condition Tags
> ** Specify allowed condition tags
> ** Filter conditions based on tags
> # Condition Type Restrictions
> ** Define disallowed condition types
> # Exclusive Parameters
> ** Support for mutually exclusive parameters
> ** Group exclusive parameters together
> # Recommended Parameters
> ** Mark parameters as recommended but not required
> # Custom Type Support
> ** Specify custom Java types for OBJECT parameters
> h3. Example Condition Type Definition
> {code:json}
> {
> "metadata": {
> "id": "propertyCondition",
> "name": "Property Condition",
> "description": "Compares a property value"
> },
> "parameters": [
> {
> "name": "propertyName",
> "type": "string",
> "validation": {
> "required": true
> }
> },
> {
> "name": "comparisonOperator",
> "type": "string",
> "validation": {
> "required": true,
> "allowedValues": ["equals", "notEquals", "greaterThan", "lessThan",
> "exists", "missing"]
> }
> },
> {
> "name": "propertyValue",
> "type": "string",
> "validation": {
> "recommended": true,
> "exclusive": true,
> "exclusiveGroup": "valueGroup"
> }
> }
> ]
> }
> {code}
> h3. Service Integration
> The validation service has been integrated with:
> * SegmentService
> * RulesService
> * GoalsService
> h3. Benefits
> * Centralized validation logic
> * Consistent validation across services
> * Clear distinction between required and recommended parameters
> * Support for complex parameter relationships
> * Type safety through custom type validation
> h2. Related Documentation
> * API Documentation: ConditionValidation class
> * Integration Examples: See SegmentServiceImpl, RulesServiceImpl, and
> GoalsServiceImpl
> * Test Cases: Validation scenarios in respective service tests
--
This message was sent by Atlassian Jira
(v8.20.10#820010)