protected override bool ValidateCriteria(IWorkflowInstantiationCriteria criteria)
        {
            var u = User.GetCurrent();
            
            if (u == null)
                return false;

            Log.Debug(string.Format("Validating criteria for user '{0}' - '{1}'", u.LoginName, u.Id));
            return TheCriteriaValidationService.IsCriteriaValid((UmbracoWorkflowInstantiationCriteria) criteria, User.GetCurrent());
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            SaveCriteriaButton.Text = TheGlobalisationService.GetString("save_criteria");

            var criteriaId = Convert.ToInt32(Request["id"]);
            _instantiationCriteria = TheWorkflowInstantiationCriteriaService.GetCriteria(criteriaId);

            Log.Debug(string.Format("Got criteria of type {0}", _instantiationCriteria.GetType()));

            _entityUi = TheWorkflowEntityUiResolver.Resolve(_instantiationCriteria);

            // if (IsPostBack) return;

            foreach (var control in _entityUi.Render(_instantiationCriteria))
            {
                CiteriaControlsPanel.Controls.Add(control);
            }
        }
 protected abstract bool ValidateCriteria(IWorkflowInstantiationCriteria criteria);
 public void Save(IWorkflowInstantiationCriteria workflowInstantiationCriteria)
 {
     TheWorkflowInstantiationCriteriaRepository.Update(workflowInstantiationCriteria);
 }