Skip to content

SAIF.NetCore.Clients.UC4 operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under operations/.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules
Construct UC4 client Validate that the environment can run UC4 scheduling and cache the base URL and route DI container resolves IUC4Client, or a caller runs new UC4Client(env, http) IEnvironmentClient, IHttpJsonClient A constructed UC4Client with ServiceUrl, ScheduleJobEndpoint, ClientName populated and IsConfigured = false BR-UC4-01, BR-UC4-02, BR-UC4-04
Schedule a UC4 job Start a named UC4/Automic job Consumer calls await client.ScheduleJob(appname, jobname) appname, jobname Task<IHttpRequestResult> BR-UC4-03, BR-UC4-06, BR-UC4-08, BR-UC4-09, BR-UC4-10

Process flow diagram

The following diagram visualizes the primary operational flow across both operations.

flowchart TD
    Start([Caller resolves or constructs IUC4Client]) --> Construct[Construct UC4 client]
    Construct --> CheckKeys{uc4coreapi:url and<br>uc4coreapi:schedulejobroute exist?}
    CheckKeys -->|No| Abort([NotSupportedException])
    CheckKeys -->|Yes| Ready(["Client ready, IsConfigured=false"])
    Ready --> Schedule[Schedule a UC4 job]
    Schedule --> FirstCall{IsConfigured == false?}
    FirstCall -->|Yes| Init["Init: SetClientInfo"]
    FirstCall -->|No| Post["POST empty JSON object {} to route+jobname"]
    Init --> Post
    Post --> Result([Return IHttpRequestResult to caller])

Failure and edge-case behavior

  • A missing uc4coreapi:url or uc4coreapi:schedulejobroute key aborts construction with NotSupportedException; the client cannot be resolved from DI in that environment (BR-UC4-01).
  • An empty (but present) uc4coreapi:url passes construction and fails only at the first ScheduleJob call, with UriFormatException (BR-UC4-02).
  • An externally-set IsConfigured = true before the first call skips Init, which can surface later as ClientNotInitializedException from the underlying HttpJsonClient (BR-UC4-07).
  • A non-success HTTP response (including after automatic retries on 401/502/503) is returned to the caller as IHttpRequestResult.IsSuccessful = false, never thrown (BR-UC4-09).

Sources

  • src/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4.csproj
  • src/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/Constants.cs
  • src/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/IUC4Client.cs
  • src/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/SAIF.NetCore.Clients.UC4/Services/UC4Client.cs