Beispiel #1
0
 public LeadScoreJob(
     ILeadScoreRuleService leadScoreRuleService,
     ILeadScoreService leadScoreService,
     IAccountService accountService,
     IMessageService messageService)
 {
     _leadScoreRuleService = leadScoreRuleService;
     _leadScoreService     = leadScoreService;
     _accountService       = accountService;
     _messageService       = messageService;
 }
 public LeadScoreProcessor(CronJobDb cronJob, JobService jobService, string leadScoreProcessorCacheName)
     : base(cronJob, jobService, leadScoreProcessorCacheName)
 {
     this.indexingService      = IoC.Container.GetInstance <IIndexingService>();
     this.contactService       = IoC.Container.GetInstance <IContactService>();
     this.searchService        = IoC.Container.GetInstance <ISearchService <Contact> >();
     this.leadScoreRuleService = IoC.Container.GetInstance <ILeadScoreRuleService>();
     this.leadScoreService     = IoC.Container.GetInstance <ILeadScoreService>();
     this.accountService       = IoC.Container.GetInstance <IAccountService>();
     this.messageService       = IoC.Container.GetInstance <IMessageService>();
 }
 public AdjustLeadScoreState(int leadScore, int workflowId, int createdBy, int accountId, int stateId,
                             ILeadScoreService leadScoreService, IWorkflowService workflowService)
     : base(stateId)
 {
     this.EntityId         = leadScore;
     this.WorkflowId       = workflowId;
     this.CreatedBy        = createdBy;
     this.accountId        = accountId;
     this.leadScoreService = leadScoreService;
     this.workflowService  = workflowService;
 }
Beispiel #4
0
 public ActionProcessor(CronJobDb cronJob, JobService jobService, string cacheName)
     : base(cronJob, jobService, cacheName)
 {
     this.workflowService      = IoC.Container.GetInstance <IWorkflowService>();
     this.campaignService      = IoC.Container.GetInstance <ICampaignService>();
     this.tagService           = IoC.Container.GetInstance <ITagService>();
     this.leadScoreService     = IoC.Container.GetInstance <ILeadScoreService>();
     this.contactService       = IoC.Container.GetInstance <IContactService>();
     this.messageService       = IoC.Container.GetInstance <IMessageService>();
     this.communicationService = IoC.Container.GetInstance <ICommunicationService>();
     this.accountService       = IoC.Container.GetInstance <IAccountService>();
 }
 public AutomationWorkflow(Workflow workflow, IWorkflowService workflowService, ITagService tagService,
                           ICampaignService campaignService, IContactService contactService, ILeadScoreService leadScoreService, IPublishSubscribeService pubSubService,
                           ICommunicationService communicationService)
 {
     this.workflow             = workflow;
     this.AccountId            = workflow.AccountID;
     this.WorkflowId           = workflow.WorkflowID;
     this.workflowService      = workflowService;
     this.tagService           = tagService;
     this.campaignService      = campaignService;
     this.contactService       = contactService;
     this.leadScoreService     = leadScoreService;
     this.pubSubService        = pubSubService;
     this.communicationService = communicationService;
     this.configure();
 }
Beispiel #6
0
 public AutomationEngine(ICachingService cachingService, IIndexingService indexingService,
                         IAdvancedSearchService advancedSearchService, IContactService contactService, IWorkflowService workflowService,
                         IAccountService accountService, ITagService tagService, ICampaignService campaignService, ILeadScoreService leadScoreService,
                         IPublishSubscribeService pubSubService, IOpportunitiesService opportunityService, ICommunicationService communicationService)
 {
     this.cachingService        = cachingService;
     this.indexingService       = indexingService;
     this.advancedSearchService = advancedSearchService;
     this.contactService        = contactService;
     this.workflowService       = workflowService;
     this.accountService        = accountService;
     this.tagService            = tagService;
     this.campaignService       = campaignService;
     this.leadScoreService      = leadScoreService;
     this.pubSubService         = pubSubService;
     this.communicationService  = communicationService;
     this.opportunityService    = opportunityService;
 }
 public WorkflowActionJob(
     IWorkflowService workflowService,
     ICampaignService campaignService,
     ITagService tagService,
     ILeadScoreService leadScoreService,
     IContactService contactService,
     IMessageService messageService,
     ICommunicationService communicationService,
     IAccountService accountService,
     JobServiceConfiguration jobConfig)
 {
     _workflowService      = workflowService;
     _campaignService      = campaignService;
     _tagService           = tagService;
     _leadScoreService     = leadScoreService;
     _contactService       = contactService;
     _messageService       = messageService;
     _communicationService = communicationService;
     _accountService       = accountService;
     _jobConfig            = jobConfig;
 }
Beispiel #8
0
        public static State GetState(Workflow workflow, BaseWorkflowAction workflowAction, int worklflowActionId,
                                     WorkflowActionType workflowActionType, IWorkflowService workflowService,
                                     ITagService tagService, ICampaignService campaignService, IContactService contactService,
                                     ILeadScoreService leadScoreService, IPublishSubscribeService pubSubService, ICommunicationService communicationService)
        {
            State currentState = null;

            //if (workflowActionType == WorkflowActionType.AddTag)
            //    currentState = new TagAddedState((workflowAction as WorkflowTagAction).TagID,
            //        workflow.WorkflowID, workflow.CreatedBy, workflowAction.WorkflowActionID, tagService, workflowService);
            //else if (workflowActionType == WorkflowActionType.RemoveTag)
            //    currentState = new TagRemovedState((workflowAction as WorkflowTagAction).TagID,
            //        workflow.WorkflowID, workflow.CreatedBy, workflowAction.WorkflowActionID, tagService, workflowService);
            //else if (workflowActionType == WorkflowActionType.SendCampaign)
            //{
            //    var action = (workflowAction as WorkflowCampaignAction);
            //    var linkIds = action.Links != null && action.Links.Count() > 0 ? action.Links.Select(l => l.LinkID) : new List<int>();

            //    currentState = new SendCampaignState(action.CampaignID,
            //        workflow.WorkflowID, workflow.CreatedBy, workflowAction.WorkflowActionID, linkIds,
            //        campaignService, workflowService);

            //    if (linkIds.Count() > 0)
            //    {
            //        //var linkAction = action.LinkAction;
            //        //var act = linkAction as WorkflowAction;
            //        currentState.SubState = StateFactory.GetState(workflow, action, action.WorkflowActionID, action.WorkflowActionTypeID,
            //            workflowService, tagService, campaignService, contactService, leadScoreService, pubSubService, communicationService);
            //        var allowedTriggers = new Dictionary<LeadScoreConditionType, WorkflowTrigger>();
            //        WorkflowTrigger trigger = new WorkflowTrigger() { SelectedLinks = linkIds };
            //        allowedTriggers.Add(LeadScoreConditionType.ContactClicksLink, trigger);
            //        currentState.SubState.AllowedTriggers = allowedTriggers;
            //        currentState.SubState.TransitionState = new SubWorkflowEndState();
            //    }
            //}
            //else if (workflowActionType == WorkflowActionType.ChangeLifecycle)
            //    currentState = new LifecycleChangedState((workflowAction as WorkflowLifeCycleAction).LifecycleDropdownValueID,
            //        workflow.WorkflowID, workflow.CreatedBy, workflowAction.WorkflowActionID, contactService, workflowService);
            //else if (workflowActionType == WorkflowActionType.TriggerWorkflow)
            //    currentState = new TriggerWorkflowState(workflow.WorkflowID, (workflowAction as TriggerWorkflowAction).SiblingWorkflowID, workflowAction.WorkflowActionID,
            //        workflowService, pubSubService);
            //else if (workflowActionType == WorkflowActionType.NotifyUser)
            //    currentState = new NotifyUserState((workflowAction as WorkflowNotifyUserAction).UserID,
            //        workflow.WorkflowID, workflow.WorkflowName, workflow.CreatedBy, workflowAction.WorkflowActionID,
            //        (workflowAction as WorkflowNotifyUserAction).MessageBody,
            //        (workflowAction as WorkflowNotifyUserAction).NotifyType, workflowService);
            //else if (workflowActionType == WorkflowActionType.AssignToUser)
            //    currentState = new AssignUserState((workflowAction as WorkflowUserAssignmentAction).UserID,
            //        workflow.WorkflowID, workflow.CreatedBy, workflowAction.WorkflowActionID, contactService, workflowService);
            //else if (workflowActionType == WorkflowActionType.AdjustLeadScore)
            //    currentState = new AdjustLeadScoreState((workflowAction as WorkflowLeadScoreAction).LeadScoreValue,
            //        workflow.WorkflowID, workflow.CreatedBy, workflow.AccountID, workflowAction.WorkflowActionID, leadScoreService, workflowService);
            //else if (workflowActionType == WorkflowActionType.SendEmail)
            //{
            //    var action = workflowAction as WorkflowEmailNotificationAction;
            //    currentState = new SendEmailState(workflow.WorkflowID, action.WorkflowActionID, action.Body, action.Subject, action.FromEmailID, workflowService, communicationService);
            //}

            //else if (workflowActionType == WorkflowActionType.SetTimer)
            //{
            //    var action = workflowAction as WorkflowTimerAction;
            //    currentState = new WaitingPeriodState(action.WorkflowActionID, action.TimerType, action.DelayPeriod, action.DelayUnit,
            //        action.RunOn, action.RunAt, action.RunType, action.RunOnDate, action.StartDate, action.EndDate, action.DaysOfWeek, workflow.WorkflowID,
            //        workflowService, pubSubService);
            //}
            //else if (workflowActionType == WorkflowActionType.UpdateField)
            //{
            //    var action = workflowAction as WorkflowContactFieldAction;
            //    currentState = new UpdateFieldState(action.FieldID, workflow.WorkflowID, action.WorkflowActionID, action.FieldValue, (int)action.FieldInputTypeId, contactService, workflowService);
            //}
            //else if (workflowActionType == WorkflowActionType.WorkflowEndState)
            //    currentState = new WorkflowEndState(workflow.WorkflowID, worklflowActionId, workflowService);

            return(currentState);
        }
Beispiel #9
0
 public MessageHandler()
 {
     this.leadScoreRuleService = IoC.Container.GetInstance <ILeadScoreRuleService>();
     this.leadScoreService     = IoC.Container.GetInstance <ILeadScoreService>();
 }