public void Execute(XElement element, string name, UrlString parameters, string value)
        {
            // Param validations
            Condition.Requires(element, nameof(element)).IsNotNull();
            Condition.Requires(name, nameof(name)).IsNotNull();
            Condition.Requires(parameters, nameof(parameters)).IsNotNull();
            Condition.Requires(value, nameof(value)).IsNotNull();

            var selectItemOptions = new SelectItemOptions();

            // Rule Condition item
            var path = XElement.Parse(element.ToString()).FirstAttribute.Value;

            if (!string.IsNullOrEmpty(path))
            {
                var ruleConditionItem = Context.ContentDatabase.GetItem(path);
                if (ruleConditionItem != null)
                {
                    selectItemOptions.FilterItem = ruleConditionItem;
                }
            }

            // Filter templates
            selectItemOptions.ShowRoot = false;
            selectItemOptions.IncludeTemplatesForSelection =
                SelectItemOptions.GetTemplateList(IoTMessageProperty.TemplateID.ToString());

            // Get Method Item
            var methodId = element.Attribute("MethodId")?.Value;

            if (string.IsNullOrEmpty(methodId))
            {
                SheerResponse.Alert("Please select a valid IoT Method");
                return;
            }
            var methodItem = Context.ContentDatabase.GetItem(methodId);

            if (methodItem == null)
            {
                SheerResponse.Alert("Please select a valid IoT Method");
                return;
            }
            var method = _ioTHubRepository.CastToMethod(methodItem);

            // Get Return Type item
            var returnTypeField = method.ReturnType;

            if (returnTypeField?.TargetItem == null)
            {
                SheerResponse.Alert($"The IoT Method item {methodItem.ID} has an invalid value in the 'Return Type' field");
                return;
            }
            var returnType = _ioTHubRepository.CastToMessageType(returnTypeField.TargetItem);

            // Selected Item
            Item propertyItem = null;

            if (!string.IsNullOrEmpty(value))
            {
                propertyItem = Context.ContentDatabase.GetItem(value);
            }

            // Setup component state
            selectItemOptions.Root         = returnType.InnerItem;
            selectItemOptions.SelectedItem = propertyItem;
            selectItemOptions.Title        = "Select Property";
            selectItemOptions.Text         = "Select the property to use in this rule.";
            selectItemOptions.Icon         = "/~/icon/office/32x32/password_field.png";

            var parameter = parameters["resulttype"];

            if (!string.IsNullOrEmpty(parameter))
            {
                selectItemOptions.ResultType =
                    (SelectItemOptions.DialogResultType)Enum.Parse(typeof(SelectItemOptions.DialogResultType),
                                                                   parameter);
            }

            SheerResponse.ShowModalDialog(selectItemOptions.ToUrlString().ToString(),
                                          "1200px", "700px", string.Empty, true);
        }
        /// <summary>
        /// Get MessageType/ReturnType for this method
        /// </summary>
        /// <returns></returns>
        public IoTMessageType GetMessageType()
        {
            var typeItem = ReturnType?.TargetItem;

            return(typeItem == null ? null : _ioTHubRepository.CastToMessageType(typeItem));
        }