Exemple #1
0
        private async Task <ActivityResponse> ExecuteActivityTaskAsync(IHostedActivities hostedActivities)
        {
            var activity     = hostedActivities.FindBy(_activityTask.ActivityType.Name, _activityTask.ActivityType.Version);
            var activityArgs = new ActivityArgs(_activityTask.Input,
                                                _activityTask.ActivityId,
                                                _activityTask.WorkflowExecution.WorkflowId,
                                                _activityTask.WorkflowExecution.RunId,
                                                _activityTask.TaskToken);

            activityArgs.StartedEventId = _activityTask.StartedEventId;
            activity.SetErrorHandler(_errorHandler);
            activity.SetSwfApi(_heartbeatSwfApi);
            return(await activity.ExecuteAsync(activityArgs));
        }
Exemple #2
0
        private async Task ExecuteInSequenceAsync(WorkerTask workerTask)
        {
            try
            {
                IHostedActivities hostedActivities = _activityHost;
                var response = await workerTask.ExecuteFor(hostedActivities);

                await _activityHost.SendAsync(workerTask.Token, response);
            }
            catch (Exception exception)
            {
                _activityHost.Fault(exception);
            }
        }
Exemple #3
0
 public async Task <ActivityResponse> ExecuteFor(IHostedActivities hostedActivities)
 {
     return(await _execute(hostedActivities));
 }