/// <summary> /// Sets values from edit form to edited workflows step info /// </summary> /// <param name="step">Edited workflow step info</param> private void SetFormValues(WorkflowStepInfo step) { if (step == null) { return; } if (ShowTimeoutForm) { Step definition = step.StepDefinition; definition.TimeoutEnabled = ucTimeout.TimeoutEnabled; definition.TimeoutInterval = ucTimeout.ScheduleInterval; if (ucTimeoutTarget.Visible) { Guid timeoutTarget = ucTimeoutTarget.SourcePointGuid; // Add timeout source point if (step.StepAllowDefaultTimeoutTarget && !definition.SourcePoints.Exists(s => (s is TimeoutSourcePoint))) { TimeoutSourcePoint timeout = new TimeoutSourcePoint(); // Timeout source point is selected if (!definition.SourcePoints.Exists(s => (s.Guid == timeoutTarget))) { timeout.Guid = timeoutTarget; } definition.SourcePoints.Add(timeout); } definition.TimeoutTarget = timeoutTarget; } else { // Remove timeout source point var timeoutPoints = definition.SourcePoints.FindAll(s => (s is TimeoutSourcePoint)); foreach (var t in timeoutPoints) { string result = step.RemoveSourcePoint(t.Guid); if (result != null) { ShowError(result); } } } } if (step.StepIsAction && ucActionParameters.Visible) { step.StepActionParameters.LoadData(ucActionParameters.Parameters.GetData()); } if (plcCondition.Visible) { CurrentStepInfo.StepDefinition.DefinitionPoint.Text = ucSourcePointEdit.CurrentSourcePoint.Text; CurrentStepInfo.StepDefinition.DefinitionPoint.Tooltip = ucSourcePointEdit.CurrentSourcePoint.Tooltip; CurrentStepInfo.StepDefinition.DefinitionPoint.Condition = ucSourcePointEdit.CurrentSourcePoint.Condition; CurrentStepInfo.StepDefinition.DefinitionPoint.Label = ucSourcePointEdit.CurrentSourcePoint.Label; } }
/// <summary> /// Sets values from edit form to edited workflows step info /// </summary> /// <param name="wsi">Edited workflow step info</param> private void SetFormValues(WorkflowStepInfo wsi) { if (wsi != null) { wsi.StepDisplayName = txtWorkflowStepDisplayName.Text; wsi.StepName = txtWorkflowStepCodeName.Text; wsi.StepAllowReject = chkAllowReject.Checked; wsi.StepAllowPublish = chkAllowPublish.Checked; if (ShowTimeout) { Step definition = wsi.StepDefinition; definition.TimeoutEnabled = ucTimeout.TimeoutEnabled; definition.TimeoutInterval = ucTimeout.ScheduleInterval; if (ucTimeoutTarget.Visible) { Guid timeouTarget = ucTimeoutTarget.SourcePointGuid; // Add timeout source point if (wsi.StepAllowDefaultTimeoutTarget && !definition.SourcePoints.Exists(s => (s is TimeoutSourcePoint))) { TimeoutSourcePoint timeout = new TimeoutSourcePoint(); // Timeout source point is selected if (!definition.SourcePoints.Exists(s => (s.Guid == timeouTarget))) { timeout.Guid = timeouTarget; } definition.SourcePoints.Add(timeout); } definition.TimeoutTarget = timeouTarget; } else { // Remove timeout source point var timeoutPoints = definition.SourcePoints.FindAll(s => (s is TimeoutSourcePoint)); foreach (var t in timeoutPoints) { string result = wsi.RemoveSourcePoint(t.Guid); if (result != null) { ShowError(result); } } } } if (wsi.StepIsAction) { wsi.StepActionParameters.LoadData(ucActionParameters.Parameters.GetData()); } } }
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 { WorkflowHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } break; case "moveup": CurrentStepInfo.MoveSourcePointUp(sourcePointGuid); WorkflowHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName);; break; case "movedown": CurrentStepInfo.MoveSourcePointDown(sourcePointGuid); WorkflowHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); break; } } }
protected void gridElem_OnAction(string actionName, object actionArgument) { Guid sourcePointGuid = ValidationHelper.GetGuid(actionArgument, Guid.Empty); if (sourcePointGuid != Guid.Empty) { switch (actionName.ToLowerCSafe()) { case "edit": if (!String.IsNullOrEmpty(ItemEditUrl)) { string url = URLHelper.AddParameterToUrl(ItemEditUrl, "workflowStepId", WorkflowStepID.ToString()); url = URLHelper.AddParameterToUrl(url, "sourcePointGuid", sourcePointGuid.ToString()); 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); } break; case "moveup": CurrentStepInfo.MoveSourcePointUp(sourcePointGuid); break; case "movedown": CurrentStepInfo.MoveSourcePointDown(sourcePointGuid); break; } } }
/// <summary> /// Sets values from edit form to edited workflows step info /// </summary> /// <param name="wsi">Edited workflow step info</param> private void SetFormValues(WorkflowStepInfo wsi) { if (wsi != null) { wsi.StepDisplayName = txtWorkflowStepDisplayName.Text; wsi.StepName = txtWorkflowStepCodeName.Text; wsi.StepAllowReject = chkAllowReject.Checked; wsi.StepAllowPublish = chkAllowPublish.Checked; if (ShowTimeout) { Step definition = wsi.StepDefinition; definition.TimeoutEnabled = ucTimeout.TimeoutEnabled; definition.TimeoutInterval = ucTimeout.ScheduleInterval; if (ucTimeoutTarget.Visible) { Guid timeouTarget = ucTimeoutTarget.SourcePointGuid; // Add timeout source point if (wsi.StepAllowDefaultTimeoutTarget && !definition.SourcePoints.Exists(s => (s is TimeoutSourcePoint))) { TimeoutSourcePoint timeout = new TimeoutSourcePoint(); // Timeout source point is selected if (!definition.SourcePoints.Exists(s => (s.Guid == timeouTarget))) { timeout.Guid = timeouTarget; } definition.SourcePoints.Add(timeout); } definition.TimeoutTarget = timeouTarget; } else { // Remove timeout source point var timeoutPoints = definition.SourcePoints.FindAll(s => (s is TimeoutSourcePoint)); foreach (var t in timeoutPoints) { string result = wsi.RemoveSourcePoint(t.Guid); if (result != null) { ShowError(result); } } } } if (wsi.StepIsAction) { wsi.StepActionParameters.LoadData(ucActionParameters.Parameters.GetData()); } } }
/// <summary> /// Sets values from edit form to edited workflows step info /// </summary> /// <param name="wsi">Edited workflow step info</param> private void SetFormValues(WorkflowStepInfo wsi) { if (wsi == null) { return; } if (ShowTimeout) { Step definition = wsi.StepDefinition; definition.TimeoutEnabled = ucTimeout.TimeoutEnabled; definition.TimeoutInterval = ucTimeout.ScheduleInterval; if (ucTimeoutTarget.Visible) { Guid timeouTarget = ucTimeoutTarget.SourcePointGuid; // Add timeout source point if (wsi.StepAllowDefaultTimeoutTarget && !definition.SourcePoints.Exists(s => (s is TimeoutSourcePoint))) { TimeoutSourcePoint timeout = new TimeoutSourcePoint(); // Timeout source point is selected if (!definition.SourcePoints.Exists(s => (s.Guid == timeouTarget))) { timeout.Guid = timeouTarget; } definition.SourcePoints.Add(timeout); } definition.TimeoutTarget = timeouTarget; } else { // Remove timeout source point var timeoutPoints = definition.SourcePoints.FindAll(s => (s is TimeoutSourcePoint)); foreach (var t in timeoutPoints) { string result = wsi.RemoveSourcePoint(t.Guid); if (result != null) { ShowError(result); } } } } if (wsi.StepIsAction) { wsi.StepActionParameters.LoadData(ucActionParameters.Parameters.GetData()); } if (plcCondition.Visible) { CurrentStepInfo.StepDefinition.DefinitionPoint.Text = ucSourcePointEdit.CurrentSourcePoint.Text; CurrentStepInfo.StepDefinition.DefinitionPoint.Tooltip = ucSourcePointEdit.CurrentSourcePoint.Tooltip; CurrentStepInfo.StepDefinition.DefinitionPoint.Condition = ucSourcePointEdit.CurrentSourcePoint.Condition; CurrentStepInfo.StepDefinition.DefinitionPoint.Label = ucSourcePointEdit.CurrentSourcePoint.Label; } }