/// <summary> /// Gets and bulk updates actions. Called when the "Get and bulk update actions" button is pressed. /// Expects the CreateAction method to be run first. /// </summary> private bool GetAndBulkUpdateActions() { // Prepare the parameters string where = "ActionName LIKE N'MyNewAction%'"; // Get the data InfoDataSet <WorkflowActionInfo> actions = WorkflowActionInfoProvider.GetWorkflowActions(where, null); if (!DataHelper.DataSourceIsEmpty(actions)) { // Loop through the individual items foreach (WorkflowActionInfo modifyAction in actions) { // Update the properties modifyAction.ActionDisplayName = modifyAction.ActionDisplayName.ToUpper(); // Save the changes WorkflowActionInfoProvider.SetWorkflowActionInfo(modifyAction); } return(true); } return(false); }
/// <summary> /// Field editor updated event. /// </summary> private void fieldEditor_OnAfterDefinitionUpdate(object sender, EventArgs e) { if (ActionInfo != null) { ActionInfo.ActionParameters = fieldEditor.FormDefinition; WorkflowActionInfoProvider.SetWorkflowActionInfo(ActionInfo); } }
/// <summary> /// Gets and updates action. Called when the "Get and update action" button is pressed. /// Expects the CreateAction method to be run first. /// </summary> private bool GetAndUpdateAction() { // Get the action WorkflowActionInfo updateAction = WorkflowActionInfoProvider.GetWorkflowActionInfo("MyNewAction", WorkflowTypeEnum.Approval); if (updateAction != null) { // Update the properties updateAction.ActionDisplayName = updateAction.ActionDisplayName.ToLowerCSafe(); // Save the changes WorkflowActionInfoProvider.SetWorkflowActionInfo(updateAction); return(true); } return(false); }
/// <summary> /// Creates workflow action. Called when the "Create action" button is pressed. /// </summary> private bool CreateAction() { // Create new workflow action WorkflowActionInfo newAction = new WorkflowActionInfo(); // Set the properties newAction.ActionDisplayName = "My new action"; newAction.ActionName = "MyNewAction"; newAction.ActionAssemblyName = "MyNewActionAssembly"; newAction.ActionClass = "MyNewActionClass"; newAction.ActionEnabled = true; // Save the action WorkflowActionInfoProvider.SetWorkflowActionInfo(newAction); return(true); }