public WorkflowAddTagResponse AddTag(WorkflowAddTagRequest request) { Logger.Current.Informational("Request received for adding a tag for a contact"); WorkflowAddTagResponse response = new WorkflowAddTagResponse(); if (request.TagId != 0 && request.ContactId != 0) { tagRepository.SaveContactTag(request.ContactId, request.TagId, request.CreatedBy, request.AccountId); accountService.InsertIndexingData(new InsertIndexingDataRequest() { IndexingData = new Domain.Accounts.IndexingData() { EntityIDs = new List <int>() { request.ContactId }, IndexType = (int)IndexType.Contacts } }); addToTopic(request.TagId, request.AccountId, request.ContactId, request.CreatedBy, true); } return(response); }
public override void OnEntry(Message message) { Logger.Current.Informational("Request received for processing TagAdd state." + ", message: " + message.MessageId); WorkflowAddTagResponse response = tagService.AddTag(new WorkflowAddTagRequest() { TagId = EntityId, ContactId = message.ContactId, CreatedBy = CreatedBy, AccountId = message.AccountId }); if (response.Exception == null) { workflowService.InsertContactWorkflowAudit(new InsertContactWorkflowAuditRequest() { WorkflowId = WorkflowId, WorkflowActionId = StateId, ContactId = message.ContactId, AccountId = message.AccountId, MessageId = message.MessageId }); } }