(string[] _)
| 28 | private const string VariablesValue = "Hello from the C# get started"; |
| 29 | |
| 30 | static async Task Main(string[] _) |
| 31 | { |
| 32 | using (var zeebeClient = CreateZeebeClient()) |
| 33 | { |
| 34 | var topology = await zeebeClient.TopologyRequest().Send(); |
| 35 | |
| 36 | Console.WriteLine("Topology: " + topology); |
| 37 | |
| 38 | await zeebeClient.NewDeployCommand().AddResourceFile("send-email.bpmn").Send(); |
| 39 | |
| 40 | var variables = $"{{\"{VariablesKey}\":\"{VariablesValue}\"}}"; |
| 41 | var processInstanceResponse = await zeebeClient |
| 42 | .NewCreateProcessInstanceCommand() |
| 43 | .BpmnProcessId("send-email") |
| 44 | .LatestVersion() |
| 45 | .Variables(variables).Send(); |
| 46 | |
| 47 | Log.LogInformation(LogMessage, |
| 48 | processInstanceResponse.ProcessDefinitionKey, |
| 49 | processInstanceResponse.BpmnProcessId, |
| 50 | processInstanceResponse.Version, |
| 51 | processInstanceResponse.ProcessInstanceKey); |
| 52 | |
| 53 | using (zeebeClient.NewWorker() |
| 54 | .JobType("email") |
| 55 | .Handler(JobHandler) |
| 56 | .MaxJobsActive(3) |
| 57 | .Timeout(TimeSpan.FromSeconds(10)) |
| 58 | .PollInterval(TimeSpan.FromMinutes(1)) |
| 59 | .PollingTimeout(TimeSpan.FromSeconds(30)) |
| 60 | .Name("CsharpGetStartedWorker") |
| 61 | .Open()) |
| 62 | { |
| 63 | AwaitExitUserCmd(); |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | |
| 69 | private static void JobHandler(IJobClient jobClient, IJob activatedJob) |
nothing calls this directly
no outgoing calls
no test coverage detected