DWISAdvisoryTemplate is a starter solution for building DWIS-based advisory services. It provides:
- a worker-hosted runtime process
- semantic input and output contracts for DWIS blackboard integration
- a shared-model generator for contextual OpenAPI schemas
- a minimal end-to-end structure that can be extended into a real advisory application
The template is intentionally light on business logic and heavy on integration scaffolding. Its purpose is to give you a working shape for a DWIS advisor, not a finished advisory implementation.
The solution currently contains three projects:
DWIS.Advisor.Template.Model- semantic data contracts and worker configuration
DWIS.Advisor.Template.ModelSharedOut- OpenAPI schema merger and generated shared DTO model
DWIS.Advisor.Template.Server- executable worker service that runs the advisory loop
The runtime flow across the solution is:
DWIS.Advisor.Template.ModelSharedOutmerges local OpenAPI dependency schemas and generates shared DTO classes.DWIS.Advisor.Template.Modelwraps those shared DTOs and defines semantic DWIS data contracts for realtime inputs, contextual inputs, and outputs.DWIS.Advisor.Template.Serverhosts a worker that connects to the DWIS blackboard, reads those inputs, deserializes contextual payloads, runs advisory logic, and publishes outputs.
In short:
ModelSharedOutdefines shared typed payloadsModeldefines DWIS-facing contractsServerruns the advisor
Out of the box, the solution already includes:
- worker configuration via
ConfigurationTemplate - realtime input definitions for common drilling signals
- contextual model definitions for:
- trajectory
- wellbore architecture
- BHA or drillstring
- a worker that:
- connects to the blackboard
- registers queries
- reads realtime and contextual data
- deserializes contextual JSON
- exposes a placeholder block for processing
- publishes outputs
What it does not include yet:
- real advisory logic
- populated output variables
- deployment-specific DWIS connection configuration
That work is expected to be added by the consumer of the template.
This project contains the semantic contract layer for the advisor.
It defines:
ConfigurationTemplateRealtimeInputsDataRealtimeOutputsDataTrajectoryDataWellBoreArchitectureDataBHADrillStringData
Those classes are built on top of DWIS.RigOS.Common.Worker and use attributes to define:
- variable access mode
- mandatory vs optional semantics
- measurable quantity
- physical location or dependency relationships
These attributes drive blackboard query and manifest generation.
Project README:
- DWIS.Advisor.Template.Model/README.md
This project is a .NET console generator that reads OpenAPI files from:
DWIS.Advisor.Template.ModelSharedOut/json-schemas
and produces:
DWIS.Advisor.Template.ModelSharedOut/TemplateMergedModel.csDWIS.Advisor.Template.Service/wwwroot/json-schema/TemplateMergedModel.json
It normalizes schema names, rewrites schema references, and generates C# DTO and client types in the DWIS.Advisor.Template.ModelShared namespace.
Project README:
- DWIS.Advisor.Template.ModelSharedOut/README.md
This project is the executable runtime host. It uses the generic .NET host and runs a Worker derived from DWISWorker<ConfigurationTemplate, object>.
The worker currently:
- connects to the DWIS blackboard
- registers queries for realtime and contextual inputs
- registers outputs for publication
- reads contextual and realtime data on each loop
- deserializes JSON payloads into generated shared DTOs
- exposes a placeholder section for advisory logic
Project README:
- DWIS.Advisor.Template.Server/README.md
A typical workflow for adapting this template is:
- Add or update shared OpenAPI dependency schemas in
DWIS.Advisor.Template.ModelSharedOut/json-schemas. - Regenerate the shared model from
DWIS.Advisor.Template.ModelSharedOut. - Add or update semantic input and output contracts in
DWIS.Advisor.Template.Model. - Implement advisory logic in
DWIS.Advisor.Template.Server/Worker.cs. - Build and run the worker locally.
- Verify that:
- queries resolve the expected blackboard variables
- contextual payloads deserialize correctly
- advisory outputs publish successfully
Build the full solution:
dotnet build .\DWIS.Advisor.Template.slnRun the server:
dotnet run --project .\DWIS.Advisor.Template.Server\DWIS.Advisor.Template.Server.csprojRegenerate the shared model:
dotnet run --project .\DWIS.Advisor.Template.ModelSharedOut\DWIS.Advisor.Template.ModelSharedOut.csprojUse this rule of thumb:
- change
ModelSharedOutwhen upstream schema dependencies change - change
Modelwhen the advisor needs different inputs, outputs, or configuration - change
Serverwhen the runtime behavior or advisory algorithm changes
If you are adding a new contextual JSON payload, you will usually touch all three projects.
The main extension points are:
- adding new realtime inputs in
RealtimeInputsData - adding new advisory outputs in
RealtimeOutputsData - adding new contextual models backed by generated shared DTOs
- implementing the actual decision logic in
Worker.cs - adding deployment-appropriate configuration, logging, and validation
- The shared model generator strips namespaces from schema names, so schema-name collisions are possible.
TemplateMergedModel.csis generated code and should not be edited manually.- The server currently uses only basic logging configuration in
appsettings.json. - The current worker loop contains placeholders and is intended to be extended.
This repository includes an MIT license:
- LICENSE
This solution gives you the skeleton of a DWIS advisory service: shared schema generation, semantic contract definition, and a runnable worker host. To turn it into a production advisor, define your required data contracts, implement the advisory logic, and validate the runtime behavior against your DWIS environment.