Ejemplo n.º 1
0
        public override Task Initialize()
        {
            //build a controls crate to render the pane
            var textBlock = UiBuilder.GenerateTextBlock("Monitor Fr8 Events",
                                                        "This Activity doesn't require any configuration.", "well well-lg");

            AddControls(textBlock);

            // var planActivatedCrate = CrateManager.CreateManifestDescriptionCrate("Available Run-Time Objects", "RouteActivated", "13", AvailabilityType.RunTime);
            // var planDeactivatedCrate = CrateManager.CreateManifestDescriptionCrate("Available Run-Time Objects", "RouteDeactivated", "13", AvailabilityType.RunTime);
            //  var containerLaunched = CrateManager.CreateManifestDescriptionCrate("Available Run-Time Objects", "ContainerLaunched", "13", AvailabilityType.RunTime);
            // var containerExecutionComplete = CrateManager.CreateManifestDescriptionCrate("Available Run-Time Objects", "ContainerExecutionComplete", "13", AvailabilityType.RunTime);
            //  var actionExecuted = CrateManager.CreateManifestDescriptionCrate("Available Run-Time Objects", "ActionExecuted", "13", AvailabilityType.RunTime);

            //  Storage.Add(planActivatedCrate);
            // Storage.Add(planDeactivatedCrate);
            //Storage.Add(containerLaunched);
            // Storage.Add(containerExecutionComplete);
            // Storage.Add(actionExecuted);

            EventSubscriptions.Manufacturer = "Fr8Core";
            EventSubscriptions.AddRange("RouteActivated", "RouteDeactivated", "ContainerLaunched", "ContainerExecutionComplete", "ActionExecuted");

            return(Task.FromResult(0));
        }
        /// <summary>
        /// Updates event subscriptions list by user checked check boxes.
        /// </summary>
        /// <remarks>The configuration controls include check boxes used to get the selected DocuSign event subscriptions</remarks>
        private void UpdateSelectedEvents()
        {
            ActivityUi activityUi = Storage.CrateContentsOfType <StandardConfigurationControlsCM>().First();

            //get selected check boxes (i.e. user wanted to subscribe these DocuSign events to monitor for)
            var curSelectedDocuSignEvents = new List <string>
            {
                activityUi.EnvelopeSentOption.Selected?activityUi.EnvelopeSentOption.Name           : string.Empty,
                activityUi.EnvelopeRecievedOption.Selected ? activityUi.EnvelopeRecievedOption.Name : string.Empty,
                activityUi.EnvelopeSignedOption.Selected ? activityUi.EnvelopeSignedOption.Name     : string.Empty
            };

            if (curSelectedDocuSignEvents.Contains(RecipientSignedEventName))
            {
                if (!curSelectedDocuSignEvents.Contains(RecipientCompletedEventName))
                {
                    curSelectedDocuSignEvents.Add(RecipientCompletedEventName);
                }
            }
            else
            {
                curSelectedDocuSignEvents.Remove(RecipientCompletedEventName);
            }

            //create standard event subscription crate with user selected DocuSign events

            EventSubscriptions.Subscriptions.Clear();
            EventSubscriptions.Manufacturer = "DocuSign";
            EventSubscriptions.AddRange(curSelectedDocuSignEvents.Where(x => !string.IsNullOrEmpty(x)));
        }
        public override Task Initialize()
        {
            Storage.Clear();

            /*
             * Discussed with Alexei and it is required to have empty Standard UI Control in the crate.
             * So we create a text block which informs the user that this particular aciton does not require any configuration.
             */
            var textBlock = UiBuilder.GenerateTextBlock("Monitor All DocuSign events", "This Action doesn't require any configuration.", "well well-lg");

            AddControl(textBlock);


            //create a Standard Event Subscription crate
            EventSubscriptions.Manufacturer = "DocuSign";
            EventSubscriptions.AddRange(DocuSignEventNames.GetAllEventNames());

            return(Task.FromResult(0));
        }