Пример #1
0
        public Task PreConsume(ConsumeContext <IManageSubscriptionsAndLicencesCommand> context)
        {
            foreach (var user in context.Message.Users)
            {
                var usersDictionary = new Dictionary <string, object>
                {
                    { "userPrincipalName", user.UserPrincipalName },
                    { "workflowActivityType", WorkflowActivityType.Office365ManageSubscription.ToString() },
                    { "messageType", context.Message.MessageType }
                };

                _workflowActivityService.Insert(new WorkflowActivityDto
                {
                    UniqueId = context.ConversationId.ToString(),
                    Context  = new WorkflowActivityContentDto
                    {
                        Timestamp = DateTime.UtcNow,
                        Data      = usersDictionary,
                        WorkflowActivityStatus = WorkflowActivityStatus.RoutingSlipStart
                    }
                });
            }

            return(Task.FromResult(context));
        }
        public Task PreConsume(ConsumeContext <IOffice365TransitionDeletePartnerPlatformUserCommand> context)
        {
            var usersDictionary = new Dictionary <string, object>
            {
                { "office365UserId", context.Message.Office365UserId },
                { "workflowActivityType", WorkflowActivityType.Office365TransitionDeletePartnerPlatformUser.ToString() }
            };

            _workflowActivityService.Insert(new WorkflowActivityDto
            {
                UniqueId = context.ConversationId.ToString(),
                Context  = new WorkflowActivityContentDto
                {
                    Timestamp = DateTime.UtcNow,
                    Data      = usersDictionary,
                    WorkflowActivityStatus = WorkflowActivityStatus.RoutingSlipStart
                }
            });

            return(Task.FromResult(context));
        }
        public Task Consume(ConsumeContext <IRoutingSlipStarted> context)
        {
            var data = context.Message.Arguments;

            data.Add("workflowActivityType", context.Message.WorkflowActivityType.ToString());

            _workflowActivityService.Insert(new WorkflowActivityDto
            {
                UniqueId = context.ConversationId.ToString(),
                Context  = new WorkflowActivityContentDto
                {
                    TrackingNumber         = context.Message.TrackingNumber,
                    Timestamp              = context.Message.CreateTimestamp,
                    Data                   = data,
                    WorkflowActivityStatus = WorkflowActivityStatus.RoutingSlipStart
                }
            });

            return(Task.CompletedTask);
        }
Пример #4
0
        public Task Consume(ConsumeContext <RoutingSlipActivityCompensated> context)
        {
            _workflowActivityService.Insert(new WorkflowActivityDto
            {
                UniqueId = context.ConversationId.ToString(),
                Context  = new WorkflowActivityContentDto
                {
                    TrackingNumber         = context.Message.TrackingNumber,
                    Timestamp              = context.Message.Timestamp,
                    ExecutionId            = context.Message.ExecutionId,
                    ActivityName           = context.Message.ActivityName,
                    Duration               = context.Message.Duration,
                    WorkflowActivityStatus = WorkflowActivityStatus.ActivityCompensated,
                    Data = context.Message.Variables
                }
            });

            return(Task.FromResult(context));
        }