protected void Page_Load(object sender, EventArgs e) { Guid sourcePointGuid = QueryHelper.GetGuid("sourcepointguid", Guid.Empty); string graphName = QueryHelper.GetString("graph", String.Empty); if (CurrentStepInfo != null) { editElem.SourcePointGuid = sourcePointGuid; editElem.RuleCategoryNames = CurrentWorkflow.IsAutomation ? ModuleName.ONLINEMARKETING : WorkflowInfo.OBJECT_TYPE; if (sourcePointGuid == Guid.Empty) { editElem.AfterCreateRedirectURL = UIContextHelper.GetElementUrl("CMS", "Workflows.EditCase", false); editElem.AfterCreateRedirectURL = URLHelper.AddParameterToUrl(editElem.AfterCreateRedirectURL, "graph", graphName); } else if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false)) { ShowChangesSaved(); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } } else { editElem.StopProcessing = true; } }
protected void EditForm_OnAfterSave(object sender, EventArgs e) { var workflowStepId = QueryHelper.GetInteger("workflowstepid", 0); var graphName = QueryHelper.GetString("graph", String.Empty); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, workflowStepId, graphName); }
protected override void OnListControlAction(string actionName, object actionArgument) { var graphName = QueryHelper.GetString("graph", String.Empty); switch (actionName.ToLowerInvariant()) { case "delete": var sourcePointGuid = ValidationHelper.GetGuid(actionArgument, Guid.Empty); if (sourcePointGuid != Guid.Empty && CreateDeleteAction(sourcePointGuid)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; case "#move": if (UniGridFunctions.TryParseMoveActionArguments(actionArgument.ToString(), out _, out var oldIndex, out var newIndex)) { if (CurrentStepInfo.MoveSourcePoint(oldIndex, newIndex)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } } break; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string graphName = QueryHelper.GetString("graph", String.Empty); if (CurrentStepInfo != null) { var sourcePointGuid = QueryHelper.GetGuid("sourcepointguid", Guid.Empty); editElem.SourcePointGuid = sourcePointGuid; editElem.RuleCategoryNames = CurrentWorkflow.IsAutomation ? ModuleName.ONLINEMARKETING : WorkflowInfo.OBJECT_TYPE; if (sourcePointGuid == Guid.Empty) { if (CurrentWorkflow.IsAutomation) { editElem.AfterCreateRedirectURL = UIContextHelper.GetElementUrl(ModuleName.ONLINEMARKETING, "EditStepProperties.Cases", false); } else { editElem.AfterCreateRedirectURL = UIContextHelper.GetElementUrl(ModuleName.CMS, "Workflows.EditCase", false); } } else if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false)) { ShowChangesSaved(); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } } else { editElem.StopProcessing = true; } }
protected void gridElem_OnAction(string actionName, object actionArgument) { Guid sourcePointGuid = ValidationHelper.GetGuid(actionArgument, Guid.Empty); if (sourcePointGuid != Guid.Empty) { string graphName = QueryHelper.GetString("graph", String.Empty); switch (actionName.ToLowerCSafe()) { case "edit": string url = URLHelper.AddParameterToUrl(UIContextHelper.GetElementUrl("CMS", "Workflows.EditCase", false), "workflowStepId", WorkflowStepID.ToString()); url = URLHelper.AddParameterToUrl(url, "isindialog", QueryHelper.GetBoolean("isindialog", false).ToString()); url = URLHelper.AddParameterToUrl(url, "hash", QueryHelper.GetHash(url)); url = URLHelper.AddParameterToUrl(url, "sourcepointGuid", sourcePointGuid.ToString()); url = URLHelper.AddParameterToUrl(url, "graph", graphName); URLHelper.Redirect(url); break; case "delete": WorkflowStepInfo step = WorkflowStepInfoProvider.GetWorkflowStepInfo(WorkflowStepID); if (step == null) { ShowError(GetString("graphservice.missingnode")); } string result = step.RemoveSourcePoint(sourcePointGuid); if (!String.IsNullOrEmpty(result)) { ShowError(result); } else { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; case "moveup": CurrentStepInfo.MoveSourcePointUp(sourcePointGuid); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName);; break; case "movedown": CurrentStepInfo.MoveSourcePointDown(sourcePointGuid); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); break; } } }
/// <summary> /// Saves data of edited source point from controls to edited object. /// </summary> /// <param name="validateData">Indicates whether form data should be validated prior to save</param> public void SaveData(bool validateData) { if (Visible && !StopProcessing) { if (!validateData || ValidateData()) { var graphName = QueryHelper.GetString("graph", String.Empty); if (CurrentSourcePoint == null) { // Create new source point SourcePoint sp = WorkflowHelper.CreateSourcePoint(CurrentWorkflow.WorkflowType, CurrentStepInfo.StepType); SetValues(sp); // AddSourcePoint saves the workflow step to database CurrentStepInfo.AddSourcePoint(sp); SourcePointGuid = sp.Guid; if (String.IsNullOrEmpty(AfterCreateRedirectURL)) { ShowChangesSaved(); } else { var queryString = $"?workflowstepid={CurrentStepInfo.StepID}&sourcepointGuid={SourcePointGuid}&graph={graphName}&saved=1"; URLHelper.Redirect(UrlResolver.ResolveUrl(URLHelper.AppendQuery(AfterCreateRedirectURL, queryString))); } } else { // Edit existing source point if (CurrentSourcePoint.Label != txtLabel.Text.Trim()) { // Refresh header ScriptHelper.RefreshTabHeader(Page); } SetValues(CurrentSourcePoint); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!StopProcessing) { ScriptHelper.RegisterDialogScript(Page); // Refresh designer after a new case is created and redirected to this page if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, QueryHelper.GetString("graph", String.Empty)); } if (CurrentStepInfo?.StepType == WorkflowStepTypeEnum.Multichoice) { ShowInformation(GetString("workflow.multichoicenotsupported")); } } }
protected override void OnListControlAction(string actionName, object actionArgument) { var sourcePointGuid = ValidationHelper.GetGuid(actionArgument, Guid.Empty); var oldIndex = CurrentStepInfo.StepDefinition.SourcePoints.FindIndex(i => i.Guid == sourcePointGuid); var graphName = QueryHelper.GetString("graph", String.Empty); if (sourcePointGuid != Guid.Empty) { switch (actionName.ToLowerInvariant()) { case "edit": var url = URLHelper.AddParameterToUrl(UIContextHelper.GetElementUrl(ModuleName.CMS, "Workflows.EditCase", false), "workflowStepId", WorkflowStepID.ToString()); url = URLHelper.AddParameterToUrl(url, "isindialog", QueryHelper.GetBoolean("isindialog", false).ToString()); url = AddHashAndGraphParametersToUrl(url, sourcePointGuid.ToString()); URLHelper.Redirect(url); break; case "delete": if (CreateDeleteAction(sourcePointGuid)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; case "moveup": if (CurrentStepInfo.MoveSourcePoint(oldIndex, oldIndex - 1)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; case "movedown": if (CurrentStepInfo.MoveSourcePoint(oldIndex, oldIndex + 1)) { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; } } }
private void RefreshDesigner() { WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, QueryHelper.GetString("graph", String.Empty)); }
protected void editForm_OnAfterSave(object sender, EventArgs e) { // Refresh updated node WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, QueryHelper.GetString("graph", String.Empty)); }