Ejemplo n.º 1
0
        public async Task CreateAndConfigureGoogle(string name)
        {
            activitiesCount++;
            var googleToken = googleTokens.AuthTokens.Where(t => t.ExternalAccountName == name).FirstOrDefault() != null?googleTokens.AuthTokens.Where(t => t.ExternalAccountName == name).FirstOrDefault() : googleTokens.AuthTokens.FirstOrDefault();

            var monitorGoogle = await _hubCommunicator.CreateAndConfigureActivity(monitorFormResponsesTmpl.Id, "Monitor Terminal Submission Form", activitiesCount, monitorTerminalSubmissions.StartingSubPlanId, false, googleToken.Id);

            SetDDL(monitorGoogle, "Selected_Google_Form", "Terminal Submission Form");
            await _hubCommunicator.ConfigureActivity(monitorGoogle);
        }
Ejemplo n.º 2
0
 public static async Task <ActivityPayload> AddAndConfigureChildActivity(this IHubCommunicator that, Guid parentActivityId, ActivityTemplateDTO activityTemplate, string name = null, string label = null, int?order = null)
 {
     //assign missing properties
     label = string.IsNullOrEmpty(label) ? activityTemplate.Label : label;
     name  = string.IsNullOrEmpty(name) ? activityTemplate.Label : label;
     return(await that.CreateAndConfigureActivity(activityTemplate.Id, name, order, parentActivityId));
 }
Ejemplo n.º 3
0
        private async Task CreateAndActivateNewMADSEPlan(IHubCommunicator hubCommunicator, AuthorizationToken authToken)
        {
            try
            {
                var emptyMonitorPlan = new PlanNoChildrenDTO
                {
                    Name        = "MonitorAllDocuSignEvents",
                    Description = "MonitorAllDocuSignEvents",
                    PlanState   = "Active",
                    Visibility  = new PlanVisibilityDTO()
                    {
                        Hidden = true
                    }
                };

                var monitorDocusignPlan = await hubCommunicator.CreatePlan(emptyMonitorPlan);

                Debug.WriteLine("Attemting to create a new MADSE plan");
                var activityTemplates = await hubCommunicator.GetActivityTemplates();

                var recordDocusignEventsTemplate = GetActivityTemplate(activityTemplates, "Prepare_DocuSign_Events_For_Storage");
                var storeMTDataTemplate          = GetActivityTemplate(activityTemplates, "Save_All_Payload_To_Fr8_Warehouse");
                Debug.WriteLine($"Calling create and configure with params {recordDocusignEventsTemplate} {authToken.UserId} {monitorDocusignPlan}");
                await hubCommunicator.CreateAndConfigureActivity(recordDocusignEventsTemplate.Id, "Record DocuSign Events", 1, monitorDocusignPlan.StartingSubPlanId, false, new Guid(authToken.Id));

                var storeMTDataActivity = await hubCommunicator.CreateAndConfigureActivity(storeMTDataTemplate.Id, "Save To Fr8 Warehouse", 2, monitorDocusignPlan.StartingSubPlanId);

                //save this
                await hubCommunicator.ConfigureActivity(storeMTDataActivity);

                await hubCommunicator.RunPlan(monitorDocusignPlan.Id, null);

                Logger.Info($"#### New MADSE plan activated with planId: {monitorDocusignPlan.Id}");
            }
            catch (Exception exc)
            {
                Logger.Error($"#### Failed to create MADSE plan for {authToken.ExternalAccountId} Exception:{exc.Message} {exc.StackTrace.Substring(255)}");
            }
        }