Add StellaOps.Workflow engine: 14 libraries, WebService, 8 test projects

Extract product-agnostic workflow engine from Ablera.Serdica.Workflow into
standalone StellaOps.Workflow.* libraries targeting net10.0.

Libraries (14):
- Contracts, Abstractions (compiler, decompiler, expression runtime)
- Engine (execution, signaling, scheduling, projections, hosted services)
- ElkSharp (generic graph layout algorithm)
- Renderer.ElkSharp, Renderer.ElkJs, Renderer.Msagl, Renderer.Svg
- Signaling.Redis, Signaling.OracleAq
- DataStore.MongoDB, DataStore.PostgreSQL, DataStore.Oracle

WebService: ASP.NET Core Minimal API with 22 endpoints

Tests (8 projects, 109 tests pass):
- Engine.Tests (105 pass), WebService.Tests (4 E2E pass)
- Renderer.Tests, DataStore.MongoDB/Oracle/PostgreSQL.Tests
- Signaling.Redis.Tests, IntegrationTests.Shared

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-20 19:14:44 +02:00
parent e56f9a114a
commit f5b5f24d95
422 changed files with 85428 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using StellaOps.Workflow.Abstractions;
using StellaOps.Workflow.Contracts;
/// <summary>Start request model for the workflow.</summary>
public sealed class ApproveApplicationRequest
{
public long SrPolicyId { get; set; }
public long SrAnnexId { get; set; }
public long SrCustId { get; set; }
public object[]? InitialTaskRoles { get; set; }
}
public sealed class ApproveApplicationWorkflow : IDeclarativeWorkflow<ApproveApplicationRequest>
{
public string WorkflowName => "ApproveApplication";
public string WorkflowVersion => "1.0.0";
public string DisplayName => "Approve Application";
public IReadOnlyCollection<string> WorkflowRoles => ["DBA", "UR_UNDERWRITER", "APR_APPL", "UR_OPERATIONS", "UR_EXCLUSIVE_AGENT", "UR_AGENT", "UR_ORG_ADMIN", "UR_HEALTH"];
public WorkflowSpec<ApproveApplicationRequest> Spec { get; } = WorkflowSpec.For<ApproveApplicationRequest>(
)
.InitializeState(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("start.srPolicyId")),
WorkflowExpr.Prop("srAnnexId", WorkflowExpr.Path("start.srAnnexId")),
WorkflowExpr.Prop("srCustId", WorkflowExpr.Path("start.srCustId")), WorkflowExpr.Prop(
"initialTaskRoles", WorkflowExpr.Func(
"coalesce", WorkflowExpr.Path("start.initialTaskRoles"), WorkflowExpr.Array())),
WorkflowExpr.Prop("lineOfBusiness", WorkflowExpr.Null()), WorkflowExpr.Prop("showRequireGroupError",
WorkflowExpr.Bool(true)), WorkflowExpr.Prop("policySubstatus", WorkflowExpr.String("REG"
)
),
WorkflowExpr.Prop("isRejected", WorkflowExpr.Bool(false)), WorkflowExpr.Prop("reopenTask",
WorkflowExpr.Bool(false)), WorkflowExpr.Prop("requiresBatch", WorkflowExpr.Bool(false
)
)
)
)
.AddTask(
WorkflowHumanTask.For<ApproveApplicationRequest>(
"Approve Application", "ApproveQTApproveApplication", "default")
.WithPayload(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId")),
WorkflowExpr.Prop("srAnnexId", WorkflowExpr.Path("state.srAnnexId"))))
.OnComplete(
flow => flow.Set("answer", WorkflowExpr.Path("payload.answer")).Set("isRejected",
WorkflowExpr.Bool(false)).Set("reopenTask", WorkflowExpr.Bool(false)).Set("requiresBatch",
WorkflowExpr.Bool(false)).WhenExpression(
"Rejected?", WorkflowExpr.Eq(
WorkflowExpr.Path("payload.answer"), WorkflowExpr.String("reject")),
whenTrue => whenTrue.Set("isRejected", WorkflowExpr.Bool(true)).Call(
"Cancel Application", new LegacyRabbitAddress("pas_annexprocessing_cancelaplorqt"
),
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId")))).Complete(
),
whenElse => whenElse.Call<object>(
"Perform Operations", new LegacyRabbitAddress(
"pas_operations_perform", WorkflowLegacyRabbitMode.MicroserviceConsumer),
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId")),
WorkflowExpr.Prop(
"runConditions", WorkflowExpr.Obj(
WorkflowExpr.Prop("lineOfBusiness", WorkflowExpr.Path("state.lineOfBusiness"
)
),
WorkflowExpr.Prop("operationType", WorkflowExpr.String("POLICY_ISSUING"
)
),
WorkflowExpr.Prop(
"stages", WorkflowExpr.Array(
WorkflowExpr.String("UNDERWRITING"), WorkflowExpr.String("CONFIRMATION"
),
WorkflowExpr.String("POST_PROCESSING")))))),
resultKey: "operations").Set(
"reopenTask", WorkflowExpr.Not(WorkflowExpr.Path("result.operations.passed"))).WhenExpression(
"Operations Passed?", WorkflowExpr.Eq(
WorkflowExpr.Path("state.reopenTask"), WorkflowExpr.Bool(false)),
whenTrue => whenTrue.Set("policySubstatus", WorkflowExpr.String("INT_TRNSF_PEND")
).Call(
"Convert Application To Policy", new LegacyRabbitAddress("pas_polreg_convertapltopol"
),
WorkflowExpr.Obj(
WorkflowExpr.Prop("SrPolicyId", WorkflowExpr.Path("state.srPolicyId")),
WorkflowExpr.Prop("Substatus", WorkflowExpr.String("INT_TRNSF_PEND")),
WorkflowExpr.Prop("ErrorIfAlreadyTheSame", WorkflowExpr.Bool(false)),
WorkflowExpr.Prop("Backdate", WorkflowExpr.Number(100)))).Call(
"Generate Policy Number", new LegacyRabbitAddress("pas_annexprocessing_generatepolicyno"
),
WorkflowExpr.Obj(
WorkflowExpr.Prop("SrPolicyId", WorkflowExpr.Path("state.srPolicyId")))).Call<object>(
"Load Policy Product Info", new LegacyRabbitAddress("pas_get_policy_product_info"
),
WorkflowExpr.Obj(
WorkflowExpr.Prop("SrPolicyId", WorkflowExpr.Path("state.srPolicyId"))),
resultKey: "productInfo").Complete(), whenElse => whenElse.ActivateTask(
"Approve Application", WorkflowExpr.Func(
"coalesce", WorkflowExpr.Path("result.operations.errorsBypassRoles"),
WorkflowExpr.Array()))))))
.StartWith(
flow => flow.SetBusinessReference(
new WorkflowBusinessReferenceDeclaration() { KeyExpression = WorkflowExpr.Path("start.srPolicyId"
),
Parts = new WorkflowNamedExpressionDefinition[] { new WorkflowNamedExpressionDefinition() { Name = "policyId",
Expression = WorkflowExpr.Path("start.srPolicyId") }, new WorkflowNamedExpressionDefinition(
) { Name = "annexId",
Expression = WorkflowExpr.Path("start.srAnnexId") }, new WorkflowNamedExpressionDefinition(
) { Name = "customerId",
Expression = WorkflowExpr.Path("start.srCustId") } } })
.ActivateTask(
"Approve Application", WorkflowExpr.Path("state.initialTaskRoles")))
.Build();
public IReadOnlyCollection<WorkflowTaskDescriptor> Tasks => Spec.TaskDescriptors;
}

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using StellaOps.Workflow.Abstractions;
using StellaOps.Workflow.Contracts;
/// <summary>Start request model for the workflow.</summary>
public sealed class AssistantPolicyReinstateRequest
{
public long SrPolicyId { get; set; }
}
public sealed class AssistantPolicyReinstateWorkflow : IDeclarativeWorkflow<AssistantPolicyReinstateRequest>
{
public string WorkflowName => "AssistantPolicyReinstate";
public string WorkflowVersion => "1.0.0";
public string DisplayName => "Assistant Policy Reinstate";
public IReadOnlyCollection<string> WorkflowRoles => ["DBA"];
public WorkflowSpec<AssistantPolicyReinstateRequest> Spec { get; } = WorkflowSpec.For<AssistantPolicyReinstateRequest>(
)
.InitializeState(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("start.srPolicyId")),
WorkflowExpr.Prop("existsOnIpal", WorkflowExpr.Bool(false)), WorkflowExpr.Prop("transferApproved",
WorkflowExpr.Bool(false))))
.AddTask(
WorkflowHumanTask.For<AssistantPolicyReinstateRequest>("Retry", "RetryReinstate",
"default")
.WithRoles("DBA")
.WithPayload(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId"))))
.OnComplete(flow => flow.Complete()))
.StartWith(
flow => flow.SetBusinessReference(
new WorkflowBusinessReferenceDeclaration() { KeyExpression = WorkflowExpr.Path("start.srPolicyId"
),
Parts = new WorkflowNamedExpressionDefinition[] { new WorkflowNamedExpressionDefinition() { Name = "policyId",
Expression = WorkflowExpr.Path("start.srPolicyId") } } })
.Call(
"Policy Reinstate INSIS", new LegacyRabbitAddress("pas_policy_reinstate_insis"),
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId"))))
.Set("existsOnIpal", WorkflowExpr.Bool(true))
.WhenExpression(
"Exists on IPAL?", WorkflowExpr.Eq(
WorkflowExpr.Path("state.existsOnIpal"), WorkflowExpr.Bool(true)),
whenTrue => whenTrue.Call(
"Transfer Annex", new LegacyRabbitAddress("pas_transfer_annex"), WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId")))).Set("transferApproved",
WorkflowExpr.Bool(true)).WhenExpression(
"Transfer approved?", WorkflowExpr.Eq(
WorkflowExpr.Path("state.transferApproved"), WorkflowExpr.Bool(true)),
whenTrue => whenTrue.Complete(), whenElse => whenElse.ActivateTask("Retry")),
whenElse => whenElse.Complete()))
.Build();
public IReadOnlyCollection<WorkflowTaskDescriptor> Tasks => Spec.TaskDescriptors;
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using StellaOps.Workflow.Abstractions;
using StellaOps.Workflow.Contracts;
/// <summary>Start request model for the workflow.</summary>
public sealed class AssistantPrintInsisDocumentsRequest
{
public long SrPolicyId { get; set; }
}
public sealed class AssistantPrintInsisDocumentsWorkflow : IDeclarativeWorkflow<AssistantPrintInsisDocumentsRequest>
{
public string WorkflowName => "AssistantPrintInsisDocuments";
public string WorkflowVersion => "1.0.0";
public string DisplayName => "Assistant Print INSIS Documents";
public IReadOnlyCollection<string> WorkflowRoles => ["DBA"];
public WorkflowSpec<AssistantPrintInsisDocumentsRequest> Spec { get; } = WorkflowSpec.For<AssistantPrintInsisDocumentsRequest>(
)
.InitializeState(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("start.srPolicyId")),
WorkflowExpr.Prop("phase", WorkflowExpr.String("starting")), WorkflowExpr.Prop("printAttempt",
WorkflowExpr.Number(0)), WorkflowExpr.Prop("lastPrintAttempt", WorkflowExpr.Number(0)
)
)
)
.AddTask(
WorkflowHumanTask.For<AssistantPrintInsisDocumentsRequest>("After Print Review",
"AfterPrintReview", "default")
.WithRoles("DBA")
.WithPayload(
WorkflowExpr.Obj(
WorkflowExpr.Prop("phase", WorkflowExpr.Path("state.phase"))))
.OnComplete(flow => flow.Complete()))
.StartWith(
flow => flow.SetBusinessReference(
new WorkflowBusinessReferenceDeclaration() { KeyExpression = WorkflowExpr.Path("start.srPolicyId"
),
Parts = new WorkflowNamedExpressionDefinition[] { new WorkflowNamedExpressionDefinition() { Name = "policyId",
Expression = WorkflowExpr.Path("start.srPolicyId") } } })
.Set("phase", WorkflowExpr.String("fork-started"))
.Fork(
"Spin off async process", branch1 => branch1.ActivateTask("After Print Review"),
branch2 => branch2.Wait("Wait 5m", WorkflowExpr.String("00:05:00")).Set("phase",
WorkflowExpr.String("timer-done")))
.Complete())
.Build();
public IReadOnlyCollection<WorkflowTaskDescriptor> Tasks => Spec.TaskDescriptors;
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using StellaOps.Workflow.Abstractions;
using StellaOps.Workflow.Contracts;
/// <summary>Start request model for the workflow.</summary>
public sealed class UpdateSrPolicyIdSrcAndCopyCoversRequest
{
public long SrPolicyId { get; set; }
}
public sealed class UpdateSrPolicyIdSrcAndCopyCoversWorkflow : IDeclarativeWorkflow<UpdateSrPolicyIdSrcAndCopyCoversRequest>
{
public string WorkflowName => "UpdateSrPolicyIdSrcAndCopyCovers";
public string WorkflowVersion => "1.0.0";
public string DisplayName => "Update Policy ID Source and Copy Covers";
public IReadOnlyCollection<string> WorkflowRoles => ["DBA"];
public WorkflowSpec<UpdateSrPolicyIdSrcAndCopyCoversRequest> Spec { get; } = WorkflowSpec.For<UpdateSrPolicyIdSrcAndCopyCoversRequest>(
)
.InitializeState(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("start.srPolicyId")),
WorkflowExpr.Prop("shouldContinue", WorkflowExpr.Bool(true))))
.StartWith(
flow => flow.SetBusinessReference(
new WorkflowBusinessReferenceDeclaration() { KeyExpression = WorkflowExpr.Path("start.srPolicyId"
),
Parts = new WorkflowNamedExpressionDefinition[] { new WorkflowNamedExpressionDefinition() { Name = "policyId",
Expression = WorkflowExpr.Path("start.srPolicyId") } } })
.Call(
"Update Policy Source", new LegacyRabbitAddress("pas_update_policy_source"),
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId"))))
.WhenExpression(
"Continue or end process", WorkflowExpr.Eq(
WorkflowExpr.Path("state.shouldContinue"), WorkflowExpr.Bool(true)),
whenTrue => whenTrue.Call(
"Copy Covers", new LegacyRabbitAddress("pas_copy_covers"), WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId")))).Complete(
),
whenElse => whenElse.Complete()))
.Build();
public IReadOnlyCollection<WorkflowTaskDescriptor> Tasks => Spec.TaskDescriptors;
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using StellaOps.Workflow.Abstractions;
using StellaOps.Workflow.Contracts;
/// <summary>Start request model for the workflow.</summary>
public sealed class UserDataCheckConsistencyRequest
{
public long SrPolicyId { get; set; }
}
public sealed class UserDataCheckConsistencyWorkflow : IDeclarativeWorkflow<UserDataCheckConsistencyRequest>
{
public string WorkflowName => "UserDataCheckConsistency";
public string WorkflowVersion => "1.0.0";
public string DisplayName => "User Data Check Consistency";
public IReadOnlyCollection<string> WorkflowRoles => ["DBA"];
public WorkflowSpec<UserDataCheckConsistencyRequest> Spec { get; } = WorkflowSpec.For<UserDataCheckConsistencyRequest>(
)
.InitializeState(
WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("start.srPolicyId")),
WorkflowExpr.Prop("isConsistent", WorkflowExpr.Bool(false))))
.StartWith(
flow => flow.SetBusinessReference(
new WorkflowBusinessReferenceDeclaration() { KeyExpression = WorkflowExpr.Path("start.srPolicyId"
),
Parts = new WorkflowNamedExpressionDefinition[] { new WorkflowNamedExpressionDefinition() { Name = "policyId",
Expression = WorkflowExpr.Path("start.srPolicyId") } } })
.Call(
"Check User Data", new LegacyRabbitAddress("pas_check_user_data"), WorkflowExpr.Obj(
WorkflowExpr.Prop("srPolicyId", WorkflowExpr.Path("state.srPolicyId"))))
.Set("isConsistent", WorkflowExpr.Bool(true))
.Complete())
.Build();
public IReadOnlyCollection<WorkflowTaskDescriptor> Tasks => Spec.TaskDescriptors;
}

View File

@@ -0,0 +1,538 @@
{
"schemaVersion": "stellaops.workflow.definition/v1",
"workflowName": "ApproveApplication",
"workflowVersion": "1.0.0",
"displayName": "Approve Application",
"startRequest": {
"contractName": "StellaOps.Workflow.Engine.Tests.TestApproveApplicationStartRequest",
"schema": {
"type": "object",
"properties": {
"srPolicyId": {
"type": "number"
},
"srAnnexId": {
"type": "number"
},
"srCustId": {
"type": "number"
},
"initialTaskRoles": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"allowAdditionalProperties": true
},
"workflowRoles": [
"DBA",
"UR_UNDERWRITER",
"APR_APPL",
"UR_OPERATIONS",
"UR_EXCLUSIVE_AGENT",
"UR_AGENT",
"UR_ORG_ADMIN",
"UR_HEALTH"
],
"businessReference": {
"keyExpression": {
"$type": "path",
"path": "start.srPolicyId"
},
"parts": [
{
"name": "policyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "annexId",
"expression": {
"$type": "path",
"path": "start.srAnnexId"
}
},
{
"name": "customerId",
"expression": {
"$type": "path",
"path": "start.srCustId"
}
}
]
},
"start": {
"initializeStateExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "srAnnexId",
"expression": {
"$type": "path",
"path": "start.srAnnexId"
}
},
{
"name": "srCustId",
"expression": {
"$type": "path",
"path": "start.srCustId"
}
},
{
"name": "initialTaskRoles",
"expression": {
"$type": "function",
"functionName": "coalesce",
"arguments": [
{
"$type": "path",
"path": "start.initialTaskRoles"
},
{
"$type": "array",
"items": []
}
]
}
},
{
"name": "lineOfBusiness",
"expression": {
"$type": "null"
}
},
{
"name": "showRequireGroupError",
"expression": {
"$type": "boolean",
"value": true
}
},
{
"name": "policySubstatus",
"expression": {
"$type": "string",
"value": "REG"
}
},
{
"name": "isRejected",
"expression": {
"$type": "boolean",
"value": false
}
},
{
"name": "reopenTask",
"expression": {
"$type": "boolean",
"value": false
}
},
{
"name": "requiresBatch",
"expression": {
"$type": "boolean",
"value": false
}
}
]
},
"initialSequence": {
"steps": [
{
"$type": "activate-task",
"taskName": "Approve Application",
"runtimeRolesExpression": {
"$type": "path",
"path": "state.initialTaskRoles"
}
}
]
}
},
"tasks": [
{
"taskName": "Approve Application",
"taskType": "ApproveQTApproveApplication",
"routeExpression": {
"$type": "string",
"value": "business/policies"
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
},
{
"name": "srAnnexId",
"expression": {
"$type": "path",
"path": "state.srAnnexId"
}
}
]
},
"taskRoles": [],
"onComplete": {
"steps": [
{
"$type": "set-state",
"stateKey": "answer",
"valueExpression": {
"$type": "path",
"path": "payload.answer"
},
"onlyIfPresent": false
},
{
"$type": "set-state",
"stateKey": "isRejected",
"valueExpression": {
"$type": "boolean",
"value": false
},
"onlyIfPresent": false
},
{
"$type": "set-state",
"stateKey": "reopenTask",
"valueExpression": {
"$type": "boolean",
"value": false
},
"onlyIfPresent": false
},
{
"$type": "set-state",
"stateKey": "requiresBatch",
"valueExpression": {
"$type": "boolean",
"value": false
},
"onlyIfPresent": false
},
{
"$type": "decision",
"decisionName": "Rejected?",
"conditionExpression": {
"$type": "binary",
"operator": "eq",
"left": {
"$type": "path",
"path": "payload.answer"
},
"right": {
"$type": "string",
"value": "reject"
}
},
"whenTrue": {
"steps": [
{
"$type": "set-state",
"stateKey": "isRejected",
"valueExpression": {
"$type": "boolean",
"value": true
},
"onlyIfPresent": false
},
{
"$type": "call-transport",
"stepName": "Cancel Application",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_annexprocessing_cancelaplorqt",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "complete"
}
]
},
"whenElse": {
"steps": [
{
"$type": "call-transport",
"stepName": "Perform Operations",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_operations_perform",
"mode": 2
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
},
{
"name": "runConditions",
"expression": {
"$type": "object",
"properties": [
{
"name": "lineOfBusiness",
"expression": {
"$type": "path",
"path": "state.lineOfBusiness"
}
},
{
"name": "operationType",
"expression": {
"$type": "string",
"value": "POLICY_ISSUING"
}
},
{
"name": "stages",
"expression": {
"$type": "array",
"items": [
{
"$type": "string",
"value": "UNDERWRITING"
},
{
"$type": "string",
"value": "CONFIRMATION"
},
{
"$type": "string",
"value": "POST_PROCESSING"
}
]
}
}
]
}
}
]
}
},
"resultKey": "operations"
},
{
"$type": "set-state",
"stateKey": "reopenTask",
"valueExpression": {
"$type": "unary",
"operator": "not",
"operand": {
"$type": "path",
"path": "result.operations.passed"
}
},
"onlyIfPresent": false
},
{
"$type": "decision",
"decisionName": "Operations Passed?",
"conditionExpression": {
"$type": "binary",
"operator": "eq",
"left": {
"$type": "path",
"path": "state.reopenTask"
},
"right": {
"$type": "boolean",
"value": false
}
},
"whenTrue": {
"steps": [
{
"$type": "set-state",
"stateKey": "policySubstatus",
"valueExpression": {
"$type": "string",
"value": "INT_TRNSF_PEND"
},
"onlyIfPresent": false
},
{
"$type": "call-transport",
"stepName": "Convert Application To Policy",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_polreg_convertapltopol",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "SrPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
},
{
"name": "Substatus",
"expression": {
"$type": "string",
"value": "INT_TRNSF_PEND"
}
},
{
"name": "ErrorIfAlreadyTheSame",
"expression": {
"$type": "boolean",
"value": false
}
},
{
"name": "Backdate",
"expression": {
"$type": "number",
"value": "100"
}
}
]
}
}
},
{
"$type": "call-transport",
"stepName": "Generate Policy Number",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_annexprocessing_generatepolicyno",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "SrPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "call-transport",
"stepName": "Load Policy Product Info",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_get_policy_product_info",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "SrPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
},
"resultKey": "productInfo"
},
{
"$type": "complete"
}
]
},
"whenElse": {
"steps": [
{
"$type": "activate-task",
"taskName": "Approve Application",
"runtimeRolesExpression": {
"$type": "function",
"functionName": "coalesce",
"arguments": [
{
"$type": "path",
"path": "result.operations.errorsBypassRoles"
},
{
"$type": "array",
"items": []
}
]
}
}
]
}
}
]
}
}
]
}
}
],
"requiredModules": [
{
"moduleName": "transport.legacy-rabbit",
"versionExpression": "\u003E=1.0.0",
"optional": false
},
{
"moduleName": "workflow.dsl.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
},
{
"moduleName": "workflow.functions.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
}
],
"requiredCapabilities": []
}

View File

@@ -0,0 +1,235 @@
{
"schemaVersion": "stellaops.workflow.definition/v1",
"workflowName": "AssistantPolicyReinstate",
"workflowVersion": "1.0.0",
"displayName": "Assistant Policy Reinstate",
"startRequest": {
"contractName": "StellaOps.Workflow.Engine.Tests.TestAssistantPolicyReinstateStartRequest",
"schema": {
"type": "object",
"properties": {
"srPolicyId": {
"type": "number"
}
}
},
"allowAdditionalProperties": true
},
"workflowRoles": [
"DBA"
],
"businessReference": {
"keyExpression": {
"$type": "path",
"path": "start.srPolicyId"
},
"parts": [
{
"name": "policyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
}
]
},
"start": {
"initializeStateExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "existsOnIpal",
"expression": {
"$type": "boolean",
"value": false
}
},
{
"name": "transferApproved",
"expression": {
"$type": "boolean",
"value": false
}
}
]
},
"initialSequence": {
"steps": [
{
"$type": "call-transport",
"stepName": "Policy Reinstate INSIS",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_policy_reinstate_insis",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "set-state",
"stateKey": "existsOnIpal",
"valueExpression": {
"$type": "boolean",
"value": true
},
"onlyIfPresent": false
},
{
"$type": "decision",
"decisionName": "Exists on IPAL?",
"conditionExpression": {
"$type": "binary",
"operator": "eq",
"left": {
"$type": "path",
"path": "state.existsOnIpal"
},
"right": {
"$type": "boolean",
"value": true
}
},
"whenTrue": {
"steps": [
{
"$type": "call-transport",
"stepName": "Transfer Annex",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_transfer_annex",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "set-state",
"stateKey": "transferApproved",
"valueExpression": {
"$type": "boolean",
"value": true
},
"onlyIfPresent": false
},
{
"$type": "decision",
"decisionName": "Transfer approved?",
"conditionExpression": {
"$type": "binary",
"operator": "eq",
"left": {
"$type": "path",
"path": "state.transferApproved"
},
"right": {
"$type": "boolean",
"value": true
}
},
"whenTrue": {
"steps": [
{
"$type": "complete"
}
]
},
"whenElse": {
"steps": [
{
"$type": "activate-task",
"taskName": "Retry"
}
]
}
}
]
},
"whenElse": {
"steps": [
{
"$type": "complete"
}
]
}
}
]
}
},
"tasks": [
{
"taskName": "Retry",
"taskType": "RetryReinstate",
"routeExpression": {
"$type": "string",
"value": "business/policies"
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
},
"taskRoles": [
"DBA"
],
"onComplete": {
"steps": [
{
"$type": "complete"
}
]
}
}
],
"requiredModules": [
{
"moduleName": "transport.legacy-rabbit",
"versionExpression": "\u003E=1.0.0",
"optional": false
},
{
"moduleName": "workflow.dsl.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
}
],
"requiredCapabilities": []
}

View File

@@ -0,0 +1,162 @@
{
"schemaVersion": "stellaops.workflow.definition/v1",
"workflowName": "AssistantPrintInsisDocuments",
"workflowVersion": "1.0.0",
"displayName": "Assistant Print INSIS Documents",
"startRequest": {
"contractName": "StellaOps.Workflow.Engine.Tests.TestAssistantPrintInsisDocumentsStartRequest",
"schema": {
"type": "object",
"properties": {
"srPolicyId": {
"type": "number"
}
}
},
"allowAdditionalProperties": true
},
"workflowRoles": [
"DBA"
],
"businessReference": {
"keyExpression": {
"$type": "path",
"path": "start.srPolicyId"
},
"parts": [
{
"name": "policyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
}
]
},
"start": {
"initializeStateExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "phase",
"expression": {
"$type": "string",
"value": "starting"
}
},
{
"name": "printAttempt",
"expression": {
"$type": "number",
"value": "0"
}
},
{
"name": "lastPrintAttempt",
"expression": {
"$type": "number",
"value": "0"
}
}
]
},
"initialSequence": {
"steps": [
{
"$type": "set-state",
"stateKey": "phase",
"valueExpression": {
"$type": "string",
"value": "fork-started"
},
"onlyIfPresent": false
},
{
"$type": "fork",
"stepName": "Spin off async process",
"branches": [
{
"steps": [
{
"$type": "activate-task",
"taskName": "After Print Review"
}
]
},
{
"steps": [
{
"$type": "timer",
"stepName": "Wait 5m",
"delayExpression": {
"$type": "string",
"value": "00:05:00"
}
},
{
"$type": "set-state",
"stateKey": "phase",
"valueExpression": {
"$type": "string",
"value": "timer-done"
},
"onlyIfPresent": false
}
]
}
]
},
{
"$type": "complete"
}
]
}
},
"tasks": [
{
"taskName": "After Print Review",
"taskType": "AfterPrintReview",
"routeExpression": {
"$type": "string",
"value": "business/policies"
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "phase",
"expression": {
"$type": "path",
"path": "state.phase"
}
}
]
},
"taskRoles": [
"DBA"
],
"onComplete": {
"steps": [
{
"$type": "complete"
}
]
}
}
],
"requiredModules": [
{
"moduleName": "workflow.dsl.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
}
],
"requiredCapabilities": []
}

View File

@@ -0,0 +1,151 @@
{
"schemaVersion": "stellaops.workflow.definition/v1",
"workflowName": "UpdateSrPolicyIdSrcAndCopyCovers",
"workflowVersion": "1.0.0",
"displayName": "Update Policy ID Source and Copy Covers",
"startRequest": {
"contractName": "StellaOps.Workflow.Engine.Tests.TestUpdateSrPolicyIdSrcAndCopyCoversStartRequest",
"schema": {
"type": "object",
"properties": {
"srPolicyId": {
"type": "number"
}
}
},
"allowAdditionalProperties": true
},
"workflowRoles": [
"DBA"
],
"businessReference": {
"keyExpression": {
"$type": "path",
"path": "start.srPolicyId"
},
"parts": [
{
"name": "policyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
}
]
},
"start": {
"initializeStateExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "shouldContinue",
"expression": {
"$type": "boolean",
"value": true
}
}
]
},
"initialSequence": {
"steps": [
{
"$type": "call-transport",
"stepName": "Update Policy Source",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_update_policy_source",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "decision",
"decisionName": "Continue or end process",
"conditionExpression": {
"$type": "binary",
"operator": "eq",
"left": {
"$type": "path",
"path": "state.shouldContinue"
},
"right": {
"$type": "boolean",
"value": true
}
},
"whenTrue": {
"steps": [
{
"$type": "call-transport",
"stepName": "Copy Covers",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_copy_covers",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "complete"
}
]
},
"whenElse": {
"steps": [
{
"$type": "complete"
}
]
}
}
]
}
},
"tasks": [],
"requiredModules": [
{
"moduleName": "transport.legacy-rabbit",
"versionExpression": "\u003E=1.0.0",
"optional": false
},
{
"moduleName": "workflow.dsl.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
}
],
"requiredCapabilities": []
}

View File

@@ -0,0 +1,110 @@
{
"schemaVersion": "stellaops.workflow.definition/v1",
"workflowName": "UserDataCheckConsistency",
"workflowVersion": "1.0.0",
"displayName": "User Data Check Consistency",
"startRequest": {
"contractName": "StellaOps.Workflow.Engine.Tests.TestUserDataCheckConsistencyStartRequest",
"schema": {
"type": "object",
"properties": {
"srPolicyId": {
"type": "number"
}
}
},
"allowAdditionalProperties": true
},
"workflowRoles": [
"DBA"
],
"businessReference": {
"keyExpression": {
"$type": "path",
"path": "start.srPolicyId"
},
"parts": [
{
"name": "policyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
}
]
},
"start": {
"initializeStateExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "start.srPolicyId"
}
},
{
"name": "isConsistent",
"expression": {
"$type": "boolean",
"value": false
}
}
]
},
"initialSequence": {
"steps": [
{
"$type": "call-transport",
"stepName": "Check User Data",
"invocation": {
"address": {
"$type": "legacy-rabbit",
"command": "pas_check_user_data",
"mode": 1
},
"payloadExpression": {
"$type": "object",
"properties": [
{
"name": "srPolicyId",
"expression": {
"$type": "path",
"path": "state.srPolicyId"
}
}
]
}
}
},
{
"$type": "set-state",
"stateKey": "isConsistent",
"valueExpression": {
"$type": "boolean",
"value": true
},
"onlyIfPresent": false
},
{
"$type": "complete"
}
]
}
},
"tasks": [],
"requiredModules": [
{
"moduleName": "transport.legacy-rabbit",
"versionExpression": "\u003E=1.0.0",
"optional": false
},
{
"moduleName": "workflow.dsl.core",
"versionExpression": "\u003E=1.0.0",
"optional": false
}
],
"requiredCapabilities": []
}