NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Virtual sleep service with Faker personal data, used in the
VIRTUAL_SIM demonstration workflow.
ObjApi.ObjApi
└── ObjServiceApi (class name: ObjServiceApi)
factory.service/package.core/ObjServiceVirtual.pyObjApi.ObjApiObjServiceVirtual.yamldata_simulationVIRTUALrun_workflow_direct(guid) sleeps a random 1-10 seconds to simulate
latency, then returns a flat dictionary of 21 fields across four groups.
Each key is available as a $key$ placeholder in any downstream
CALC node SQL through patch_param_calc attribute scanning.
| Method | Description |
|---|---|
__init__(self, DB=0) |
Initialise with _IsA = "ObjServiceVirtual" |
run_workflow_direct(self, guid, current_result="") |
Sleep 1-10s then return a dict of 21 fake personal data fields |
| Key | Type | Notes |
|---|---|---|
first_name |
str | Faker first name |
last_name |
str | Faker last name |
email |
str | Faker email (contains @) |
phone |
str | Faker phone number |
address |
str | Faker street address |
city |
str | Faker city |
country |
str | Faker country |
| Key | Type | Range |
|---|---|---|
call_priority |
int | 1 - 10 |
dialler_worked |
int | 0 - 10 |
valid_cell |
int (0/1) | boolean |
saturday |
int (0/1) | boolean |
| Key | Type | Range |
|---|---|---|
age |
int | 18 - 80 |
income |
float | 5 000 - 200 000 |
credit_score |
int | 300 - 850 |
months_employed |
int | 0 - 480 |
balance |
float | 0 - 100 000 |
transactions |
int | 0 - 500 |
| Key | Type | Values |
|---|---|---|
gender |
str | M, F |
marital_status |
str | S, M, D, W |
employment_status |
str | EMPLOYED, SELF_EMPLOYED, UNEMPLOYED, RETIRED |
risk_band |
str | LOW, MEDIUM, HIGH |
The companion workflow is seeded via resource.notes/virtual_workflow_seed.sql.
| Rank | Type | Name | Purpose |
|---|---|---|---|
| 1 | START | virtual_sim | Kick off workflow |
| 2 | CALC | SIM_START | INSERT data_simulation with start time |
| 3 | SERVICE | VIRTUAL | Sleep 1-10s, return 21-field dict |
| 4 | CALC | SIM_END | UPDATE data_simulation with end time |
| 5 | CALC | SIM_PERSONAL | UPDATE data_simulation with personal data (7 fields) |
| 6 | CALC | SIM_METRICS | UPDATE data_simulation with decision/scorecard data |
| 7 | DONE | DONE | End |
Defined in ObjServiceVirtual.yaml:
| Column | Type | Source | Description |
|---|---|---|---|
| SimGuid | varchar(255) | PK | Workflow process GUID |
| Package | varchar(100) | SIM_START | Active package |
| WorkflowName | varchar(100) | SIM_START | Always VIRTUAL_SIM |
| StartTime | datetime | SIM_START | Workflow start |
| EndTime | datetime | SIM_END | Workflow end |
| FirstName | varchar(100) | SIM_PERSONAL | Faker first name |
| LastName | varchar(100) | SIM_PERSONAL | Faker last name |
| varchar(255) | SIM_PERSONAL | Faker email | |
| Phone | varchar(50) | SIM_PERSONAL | Faker phone |
| Address | varchar(255) | SIM_PERSONAL | Faker street address |
| City | varchar(100) | SIM_PERSONAL | Faker city |
| Country | varchar(100) | SIM_PERSONAL | Faker country |
| CallPriority | int | SIM_METRICS | Decision input (1-10) |
| DiallerWorked | int | SIM_METRICS | Decision input (0-10) |
| ValidCell | tinyint(1) | SIM_METRICS | Decision boolean (0/1) |
| Saturday | tinyint(1) | SIM_METRICS | Decision boolean (0/1) |
| Age | int | SIM_METRICS | Scorecard variable (18-80) |
| Income | decimal(12,2) | SIM_METRICS | Scorecard variable |
| CreditScore | int | SIM_METRICS | Scorecard variable (300-850) |
| MonthsEmployed | int | SIM_METRICS | Scorecard variable (0-480) |
| Balance | decimal(12,2) | SIM_METRICS | Feature store numeric |
| Transactions | int | SIM_METRICS | Feature store numeric (0-500) |
| Gender | varchar(10) | SIM_METRICS | Scorecard categorical (M/F) |
| MaritalStatus | varchar(10) | SIM_METRICS | Scorecard categorical |
| EmploymentStatus | varchar(50) | SIM_METRICS | Scorecard categorical |
| RiskBand | varchar(20) | SIM_METRICS | Feature store categorical |
| Module | varchar(255) | - | Organisational field |
ServiceCode = 'VIRTUAL'
Service = 'ObjServiceVirtual'
Package = 'CORE'
Run from the project root:
python factory.service/package.core/ObjServiceVirtual.py --help
| Command | Args / Options | Description |
|---|---|---|
run |
[GUID] |
Single invocation; auto-generates GUID if omitted |
run-multi |
-n N (default 3) |
N invocations with per-run and summary timing |
create-table |
- | Creates data_simulation table in active DB |
records |
-l N (default 10) |
Shows N most recent data_simulation rows |
Tests live in resource.test/pytests/factory.service/package.core/test_ObjServiceVirtual.py.
pytest resource.test/pytests/factory.service/package.core/test_ObjServiceVirtual.py -v
Test classes:
| Class | Coverage |
|---|---|
TestRunWorkflowDirect |
Return shape, key set, value types, email format, sleep call count and range, Faker randomness, debug logging |
TestLatencySimulation |
randint wiring, min/max boundary values |
TestIdentity |
_IsA attribute, class naming convention |
TestYamlSchema |
YAML loads, schema presence, all required columns, primary key |
TestCliCommands |
All four CLI functions are callable |
cythonize -3 -a -i ObjServiceVirtual.py
Updated: 2026-03-20