Exemple #1
0
        private void UpdateDefinition(int rowIndex, PluginResult activityUpdateType)
        {
            ComboBox actionCombo      = (ComboBox)main_TableLayoutPanel.GetControlFromPosition(ACTION_COLUMN, rowIndex);
            TextBox  retryTextBox     = (TextBox)main_TableLayoutPanel.GetControlFromPosition(RETRY_LIMIT_COLUMN, rowIndex);
            var      delayTimeSpan    = (HP.ScalableTest.Framework.UI.TimeSpanControl)main_TableLayoutPanel.GetControlFromPosition(RETRY_DELAY_COLUMN, rowIndex);
            ComboBox retryActionCombo = (ComboBox)main_TableLayoutPanel.GetControlFromPosition(RETRY_ACTION_COLUMN, rowIndex);

            // Add it to all of the configurations
            foreach (var c in _configurations)
            {
                VirtualResourceMetadataRetrySetting retrySetting = new VirtualResourceMetadataRetrySetting();
                retrySetting.SettingId = SequentialGuid.NewGuid();
                retrySetting.State     = activityUpdateType.ToString();
                retrySetting.Action    = actionCombo.Text;
                int limitValue = 0;
                if (!int.TryParse(retryTextBox.Text, out limitValue))
                {
                    limitValue = 0;
                }
                retrySetting.RetryLimit          = limitValue;
                retrySetting.RetryDelay          = Convert.ToInt32(delayTimeSpan.Value.TotalSeconds);
                retrySetting.LimitExceededAction = retryActionCombo.Text;

                c.Metadata.VirtualResourceMetadataRetrySettings.Add(retrySetting);
            }
        }
        /// <summary>
        /// Defines and executes the $safeclassprefix$ workflow.
        /// </summary>
        /// <param name="executionData">Information used in the execution of this workflow.</param>
        /// <returns>The result of executing the workflow.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            PluginResult result = PluginResult.Passed;

            _data = executionData.GetMetadata <$safeclassprefix$ActivityData>();

            UpdateStatus("Starting execution");

            UpdateStatus("Completing execution");
            UpdateStatus("Result = " + result.ToString());
            return(new PluginExecutionResult(result));
        }