예제 #1
0
        public async Task <IActionResult> ExecuteSync([FromBody] PadExecution request)
        {
            var pad = PadFactory.CreateInstance(request.Pad, ExecutionMode.Normal, request.Instances);
            await pad.Init();

            await pad.Execute(pad.Context, request.Instances);

            var result = new ExecutionResult
            {
                PadIdentifier = request.Pad.Identifier,
                Status        = pad.Context.Status,
                Summary       = pad.Context.ExecutionSummary,
                Result        = pad.Context.Result
            };

            using (var padmgr = this.clientFactory.CreateClient("padMgr"))
            {
                var histResponse = await padmgr.PostAsJsonAsync <ExecutionResult>($"/api/pad/history?userId={request.UserId}", result);
            }
            return(Ok(result));
        }
예제 #2
0
        public async Task <IActionResult> Execute([FromBody] PadExecution pad)
        {
            await this.eventBus.Publish(pad);

            return(Ok());
        }