Skip to content

Get execution progress messages

The Platform eventing service can be used to subscribe to the events emmitted by engine execution. For a guide on how to subscribe to platform events, see Subscribe to events.

During the process of the execution, the engine provides progress messages:

{
  "specversion": "1.0",
  "customerid": "f0b919d1-80c2-49e4-9e27-31e4e9b9fdfa",
  "projectid": "98da827b-407c-418d-8064-6c27b5417bfb", 
  "userid": "6131709d-3181-4372-8bef-e33498e09333",
  "resourceid": "603f5c80-f190-4fab-822b-6cf28614ae82",
  "type": "dhi.waterdata.engines.eventing.contracts.messages.v3.engineexecutionprogressmessage",
  "source": "/dhi/platform/engineexecution",
  "id": "29679e70-6f83-4752-b70e-6e0794180d23",
  "time": "2021-04-26T08:39:08.0474107Z",
  "subject": "Progress update",
  "dataschema": "https://schemas.mike-cloud.com/platform/engineexecution/v3.0/engineexecutionprogressmessage", 
  "datacontenttype": "application/json",
  "data": {
    "EngineExecutionProgress": {
      "$type": "System.Collections.Generic.SortedDictionary`2[[System.String, System.Private.CoreLib],[System.String, System.PrivateCoreLib]], System.Collections",
      "COMSPD": "733414",
      "MESLBL": "Simulation time step",
      "MESSAG": "Time step: 6320",
      "PROGRE": "877",
      "STALBL": "Simulation date and time [YYYY-MM-DD hh:mm:ss]",
      "STATUS": "2004-01-01 03:30:40",
      "TIMLFT": "1",
    }
    "EngineName": "FemEngineHD",
    "EngineVersion": "2021.0",
    "RunningSetupIndex": 0,
    "TotalNumberOfSetups": 1
  },
  "offset": "25780313304"
}

Once the execution is finished, a message with its result is emitted. E.g., the following message will be received for an engine execution running a single model using the "FemEngineHD" engine:

{
  "specversion": "1.0",
  "customerid": "f0b919d1-80c2-49e4-9e27-31e4e9b9fdfa",
  "projectid": "98da827b-407c-418d-8064-6c27b5417bfb", 
  "userid": "6131709d-3181-4372-8bef-e33498e09333", 
  "resourceid": "603f5c80-f190-4fab-822b-6cf28614ae82",
  "type": "dhi.waterdata.engines.eventing.contracts.messages.v3.engineexecutionstatuschangedmessage",
  "source": "/dhi/platform/engineexecution",
  "id": "47ee747d-0f1f-4ed3-9c95-173a311aa745",
  "time": "2021-04-26T08:39:02.5923813Z",
  "subject": "Result",
  "dataschema": "https://schemas.mike-cloud.com/platform/engineexecution/v3.0/engineexecutionstatuschangedmessage", 
  "datacontenttype": "application/json",
  "data": {
    "Message": "Results uploaded",
    "Status": "Success",
    "EngineName": "FemEngineHD",
    "EngineVersion": "2020.1",
    "RunningSetupIndex": 0,
    "TotalNumberOfSetups": 1
    },
  "offset": "25784134720"
}

The status might be also Cancelled or Failure in correspondent scenarios.

If you choose to cancel the execution, you will get the cancellation message as well:

{
  "specversion": "1.0",
  "customerid": "f0b919d1-80c2-49e4-9e27-31e4e9b9fdfa",
  "projectid": "da2ca6d3-1731-42d9-bf8e-535362aac0e8", 
  "userid": "d7b49ffb-5dc2-4caa-8439-045a89499891", 
  "resourceid": "a129a53e-d312-4ba2-9fce-770e8ff87c85",
  "type": "dhi.waterdata.engines.eventing.contracts.messages.v1.engineexecutioncancellationmessage",
  "source": "/dhi/platform/engineexecution",
  "id": "b69404a3-f8ed-4a24-9a1c-adb7d3e40acd",
  "time": "2022-03-30T15:23:55.9460581Z",
  "subject": "Cancel",
  "dataschema": "https://schemas.mike-cloud.com/platform/engineexecution/v1.0/engineexecutioncancellationmessage", 
  "datacontenttype": "application/json",
  "data": { },
  "offset": "936329059456"
}

Here you may find the complete list of supported messages.