Skip to content

Commit

Permalink
Add methods for brs descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebbeknudsen committed Nov 19, 2024
1 parent 02c20b6 commit 12111ef
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions source/ProcessManager.Orchestrations/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,8 @@
// We could implement an interface for "description building" which could then be implemented besides the orchestration.
// During DI we could then search for all these interface implementations and register them automatically.
// This would ensure we didn't have to update Program.cs when we change orchestrations.
var brs_023_027_v1 = new OrchestrationDescription(
name: "BRS_023_027",
version: 1,
canBeScheduled: true,
functionName: nameof(NotifyAggregatedMeasureDataOrchestrationV1));

brs_023_027_v1.ParameterDefinition.SetFromType<NotifyAggregatedMeasureDataInputV1>();

brs_023_027_v1.AppendStepDescription("Beregning");
brs_023_027_v1.AppendStepDescription(
"Besked dannelse",
canBeSkipped: true,
skipReason: "Do not perform this step for an internal calculation.");

var brs_026_v1 = new OrchestrationDescription(
name: "BRS_026",
version: 1,
canBeScheduled: false,
functionName: nameof(RequestCalculatedEnergyTimeSeriesOrchestrationV1));
brs_026_v1.ParameterDefinition.SetFromType<RequestCalculatedEnergyTimeSeriesInputV1>();
brs_026_v1.AppendStepDescription("Asynkron validering");
brs_026_v1.AppendStepDescription("Hent anmodningsdata");
brs_026_v1.AppendStepDescription("Udsend beskeder");
var brs_023_027_v1 = CreateBRS_023_027_V1Description();
var brs_026_v1 = CreateBRS_026_V1Description();

return [brs_023_027_v1, brs_026_v1];
});
Expand All @@ -82,3 +61,35 @@

await host.SynchronizeWithOrchestrationRegisterAsync("ProcessManager.Orchestrations").ConfigureAwait(false);
await host.RunAsync().ConfigureAwait(false);

OrchestrationDescription CreateBRS_023_027_V1Description()
{
var brs023027V1 = new OrchestrationDescription(
name: "BRS_023_027",
version: 1,
canBeScheduled: true,
functionName: nameof(NotifyAggregatedMeasureDataOrchestrationV1));

brs023027V1.ParameterDefinition.SetFromType<NotifyAggregatedMeasureDataInputV1>();

brs023027V1.AppendStepDescription("Beregning");
brs023027V1.AppendStepDescription(
"Besked dannelse",
canBeSkipped: true,
skipReason: "Do not perform this step for an internal calculation.");
return brs023027V1;
}

OrchestrationDescription CreateBRS_026_V1Description()
{
var brs026V1 = new OrchestrationDescription(
name: "BRS_026",
version: 1,
canBeScheduled: false,
functionName: nameof(RequestCalculatedEnergyTimeSeriesOrchestrationV1));
brs026V1.ParameterDefinition.SetFromType<RequestCalculatedEnergyTimeSeriesInputV1>();
brs026V1.AppendStepDescription("Asynkron validering");
brs026V1.AppendStepDescription("Hent anmodningsdata");
brs026V1.AppendStepDescription("Udsend beskeder");
return brs026V1;
}

0 comments on commit 12111ef

Please sign in to comment.