Status: Legacy service proxy
Module: factory.service/package.core/ObjServiceSegmentation.py
Service API for managing and computing data segments using the
legacy def_segment table. The compute_segment() method now
delegates evaluation to ObjDecisionSegmentation.evaluate() in
factory.core, making this class a thin proxy for the core engine.
New segments should use ObjDecisionSegmentation directly with
the DECISIONSEGMENT workflow node type.
ObjServiceApi(ObjApi)
|
| compute_segment() creates ObjDecisionSegmentation
| instance, copies legacy attributes, delegates
| to core.evaluate()
|
| provision(), read(), lookup_segment(), annotate
| methods remain in the service layer
|
v
ObjDecisionSegmentation.evaluate(context, input_guid)
The evaluation logic has been moved to the core engine.
compute_segment() now:
ObjDecisionSegmentation instance with self.DB_Segmentname -> segment_name_Basetable -> base_table_Baserank -> base_rank_Baseguid -> base_guid_Basevalues -> base_values_Inputguid -> input_guid_Metasegment -> meta_segmentoperations -> operationsinput_guid from context if not provided_Inputsql if configured (pre-populates context)core.evaluate(context, input_guid)These methods remain in the service layer (not proxied):
| Method | Purpose |
|---|---|
provision() |
Create/update segment operators in DB |
provision_form(segment_name) |
Create add/edit forms for segment |
read(segment_name) |
Load segment definition from def_segment |
segment_annotate(table_name) |
Add segment columns to meta table |
query_annotate(sql) |
Annotate column meta from SQL query |
table_annotate(table_name) |
Annotate column meta from table |
lookup_segment(context, guid) |
Read from meta table |
run_workflow_direct(guid) |
Direct workflow execution |
| Legacy (SEGMENT) | New (DECISIONSEGMENT) | |
|---|---|---|
| Config table | def_segment |
def_decision_segment |
| Service | This class | ObjDecisionSegmentation directly |
| Workflow node | ObjWorkflowSegment |
ObjWorkflowDecisionSegment |
| Versioned | No | Yes |
| Evaluation | Proxied to core | Native |
Both paths now use the same core evaluation engine. The only
difference is the config table used to define segments.
# Visualise a segment
python factory.service/package.core/ObjServiceSegmentation.py \
visual seg_limits GUID
# Verify a segment against test data
python factory.service/package.core/ObjServiceSegmentation.py \
verify seg_limits
# Provision forms for a segment
python factory.service/package.core/ObjServiceSegmentation.py \
provision seg_limits
| File | Purpose |
|---|---|
factory.core/ObjDecisionSegmentation.py |
Core evaluation engine |
factory.core/ObjDecisionSegmentation.md |
Core documentation |
factory.workflow/ObjWorkflowSegment.py |
Legacy SEGMENT workflow node |
factory.workflow/ObjWorkflowDecisionSegment.py |
New DECISIONSEGMENT node |
Updated: 2026-03-31