Nintex Workflow 2007 SDK 1.2
Nintex Workflow 2007 SDK 1.2
WHATS NEW?
Section on creating custom task forms for the Flexi Task action Updated the task form example to support Flexi Task action New web service methods: ProcessFlexiTaskResponse2 and GetOutcomesForFlexiTask Updated web service methods with a more descriptive return type: ProcessTaskResponse3, ProcessFlexiTaskResponse2 Added descriptions for web service methods AddLongTermDelegationRule, DeleteLongTermDelegationRule and the PublishFromNWF* and SaveFromNWF* methods
www.nintex.com
connect.nintex.com
Nintex Connect The Nintex Connect site provides a forum for discussing the use and development of Nintex Workflow 2007, along with additional examples and downloads. Download: http://connect.nintex.com
Microsoft .NET Framework 3.0 Redistributable Package The Microsoft .NET Framework version 3.0 redistributable package installs the common language runtime and associated files required to run applications developed to target the .NET Framework 3.0. Download: http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F525634C3BF043&displaylang=en
Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation) This addin provides developers with support for building workflow-enabled applications using Windows Workflow Foundation. Compatible with the released versions of the 2007 Microsoft Office system, Microsoft Windows Vista, and the .NET Framework 3.0 Runtime Components. Download: http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023E8F38E709BA6&displaylang=en
Microsoft Visual Studio 2005 Team Suite Service Pack 1 This download installs Service Pack 1 for Microsoft Visual Studio 2005 Standard and Professional, and Team editions. Download: http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D37BAF6B5B1DC&displaylang=en
Visual Studio 2005 Service Pack 1 Update for Windows Vista The Visual Studio 2005 Service Pack 1 Update for Windows Vista addresses areas of Visual Studio impacted by Windows Vista enhancements. Download: http://www.microsoft.com/downloads/details.aspx?FamilyID=90e2942d-3ad1-4873-a2ee4acc0aace5b6&displaylang=en
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 Office InfoPath 2007
You may receive warning messages about the publishing location of the provided SDK example InfoPath Form. You should ignore the messages and once the form is loaded, republish it and then open the form from its published location.
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. 3. 4. 5. 6. Form data Form UI Add data connections to Nintex Workflow Add business logic (rules) Publish the form Create workflow
www.nintex.com
connect.nintex.com
Tip: How to add a group 1. 2. 3. 4. 5. From the Task Pane, select Data Sources. Right click on the top group, and select Add. In the Name field enter the group name. Select Group from the Type field. Click Ok.
6.
Add the following fields to the corresponding groups in the Main data source. Field Name Date Description Amount Total ID Name Email Department Submitted ExpenseState FileUrl WorkflowStatus AllowEditing AllowApproval Comments Group Item Item Item Items Employee Employee Employee Employee ExpenseForm ExpenseForm ExpenseForm ExpenseForm ExpenseForm ExpenseForm ExpenseApproval Type Date String Decimal Decimal String String String String True/False String String String True/False True/False Rich Text
www.nintex.com
connect.nintex.com
Image of data source with fields Tip: How to add a field 1. 2. 3. 4. 5. From the Task Pane, select Data Sources. Right click on the required group, and select Add. In the Name field enter the field name. Select the required field type from the Type field. Click Ok
Step 2 Form UI The figure below shows the empty form that the next section will use as a base. This form can be found in the solution files for this example.
Figure: expense_basic.xsn from the solution files, the basic layout only.
www.nintex.com
connect.nintex.com
2. 3.
Note: When binding a field control you must always bind it to a field in the data source. However controls such as the Section control can be bound to a group in the data source. 2. Add the fields to the surface area: a. Add fields ID, Name, Email and Department to the Employee Information section. b. Add field Item as a Repeating Table to the section Expenses. Display the footer on the repeating table (Repeating table properties | Display | Options | Include Footer). Add the Total field to the repeating table footer. Set the Total fields default value to sum(Amount) (this will calculate each item in the expense from and give us a single total). c. Add field Comments to the Approval section. Tip: How add a field to the design area To add a field from the data source tool pane, you can simply drag and drop it on to the design area. Once it is there you can adjust the size and properties (including validation rules, conditional formatting, etc).
Tip: How to set a default value on a field You can set the default value for a field control from the properties window for the control. The following steps show how to set the default for a text field control. 1. Right click on the text box. 2. Click Text Box Properties. 3. In the properties window enter the default value into the Value field under the heading Default Value. Note: Default values can be calculated, which allows you to use a combination of lookups, functions and hard coded values. 4. Add buttons to control the approval process. These buttons will be used for the key actions on the form (submit, approve and reject). a. Add two buttons to the Approval section titled Approve and Reject b. Add a button to the last section of the form titled Submit.
The form UI has now been designed. Next we need to configure the form to communicate with the Nintex Workflow web service.
www.nintex.com
connect.nintex.com
Step 3 Data Connections 1. Add a new data source to receive the current workflow tasks for the current user from a web service. a. Click the Tools menu and select Data Connections b. Click Add c. Select Create a new data connection to: and select Receive data. Click Next d. Select Web service and click Next e. Enter the URL http://development.nintex.com/_vti_bin/nintexworkflow/workflow.asmx?WSDL, remembering to replace http://development.nintex.com with a url to a teamsite in your environment. Click Next f. From the selection of operations select GetRunningWorkflowTasksForCurrentUser. Click Next g. Click Next h. When asked to store a copy of the data in the form template, ensure this is not selected as it is not required and could cause issues. Click Next i. When asked if the form must automatically retrieve data when it is opened ensure this is not selected. Click Finish. Add a new data source to process the workflow task (approve/reject) for the current user from a web service. a. From the file menu click Tools -> Data Connections b. Click Add c. Select Create a new data connection to: and select Receive data, click Next d. Select Web service and click Next e. Enter the URL http://development.nintex.com/_vti_bin/nintexworkflow/workflow.asmx?WSDL. Click Next f. From the selection of operations select ProcessTaskResponse. Click Next g. Click Next h. When asked to store a copy of the data in the form template, ensure this is not selected, as it is not required, and would cause issues. Click Next i. When asked if you want to automatically retrieve data when the form is opened ensure this is not selected, click Finish.
2.
www.nintex.com
connect.nintex.com
Step 4 Business Logic (Rules) 1. Configure the open behavior for the form: a. From Tools | Form Options select Open and Save, the click on Rules b. Add the rules outlined below. Use the Field Name References row as a fully qualified field reference. This will allow you to find the correct field in the Main data source. Name Conditions Actions Field Fully Qualified References Load Workflow Information FileUrl != 1. Set a fileUrl = FileUrl 2. Query using a data connection: GetRunningWorkflowTasksForCurrentUser fileUrl = GetRunningWorkflowTasksForCurrentUser /dfs:myFields/dfs:queryFields/ tns:GetRunningWorkflowTasksForCurrentUser/tns:fileUrl fileUrl = /my:expenseReport/my:ExpenseForm/my:FileUrl
www.nintex.com
connect.nintex.com
Figure: Screenshot from InfoPaths logic inspector Name Conditions Setup editing control Submitted = string(false()) OR Submitted = string(true()) AND SharePointTaskId != "" AND TaskType = "Approval" 2. Set a field's value: AllowEditing = true() Submitted = /my:expenseReport/my:ExpenseForm/my:Submitted SharePointTaskId = GetRunningWorkflowTasksForCurrentUser /dfs:myFields/dfs:dataFields/ tns:GetRunningWorkflowTasksForCurrentUserResponse/ tns:GetRunningWorkflowTasksForCurrentUserResult/tns:UserTask/ tns:SharePointTaskId TaskType = GetRunningWorkflowTasksForCurrentUser /dfs:myFields/dfs:dataFields/ tns:GetRunningWorkflowTasksForCurrentUserResponse/ tns:GetRunningWorkflowTasksForCurrentUserResult/tns:UserTask/tns:TaskType
www.nintex.com
connect.nintex.com
Figure: Screenshot from InfoPaths logic inspector 3. Configure the Reject button rules. a. Right click on the Reject button and click Properties b. Click on the Rules button c. Add the rules outlined below. Use the Field Name References row as a fully qualified field reference. This will allow you to find the correct field in the Main data source. Name Conditions Actions Set Rejection Settings 1. 2. 3. 4. 5. Set a field's value: spTaskId = SharePointTaskId Set a field's value: outcome = "Rejected" Set a field's value: comments = Comments Query using a data connection: ProcessTaskResponse Close the form spTaskId = /dfs:myFields/dfs:queryFields/tns:ProcessTaskResponse/tns:spTaskId SharePointTaskId = GetRunningWorkflowTasksForCurrentUser /dfs:myFields/dfs:dataFields/ tns:GetRunningWorkflowTasksForCurrentUserResponse/ tns:GetRunningWorkflowTasksForCurrentUserResult/tns:UserTask/ tns:SharePointTaskId outcome = /dfs:myFields/dfs:queryFields/tns:ProcessTaskResponse/tns:outcome comments = /dfs:myFields/dfs:queryFields/tns:ProcessTaskResponse/ tns:comments Comments = /my:expenseReport/my:ExpenseForm/my:Comments
www.nintex.com
connect.nintex.com
Figure: Screenshot from InfoPaths logic inspector 4. Configure the Submit button rules. a. Right click on the Submit button and click Properties b. Click on the Rules button c. Add the rules outlined below. Use the Field Name References row as a fully qualified field reference. This will allow you to find the correct field in the Main data source. Name Conditions Actions Submit Expense 1. 2. 3. Set a field's value: Submitted = true() Submit using a data connection: SharePoint Library Submit Close the form Submitted = /my:expenseReport/my:ExpenseForm/my:Submitted
Figure: Screenshot from InfoPaths logic inspector 5. Configure advanced form UI a. Now the business logic has been created we have a field called AllowEditing which was configured in rule Setup editing control. With this field we can configure the relevant form controls to allow editing or to display a read only view. Use this field and configure the input fields Conditional Formatting. b. Configure the Approval section to only display if the field AllowApproval is true. c. Configure the Submit section to only display if the field Submitted is false
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
5. 6.
7.
8.
9.
www.nintex.com
connect.nintex.com
REQUIREMENTS
Windows SharePoint Services 3.0 Nintex Workflow 2007 Visual Studio
SUMMARY
1. 2. 3. 4. 5. Background Information Steps to Create an Action The Nintex Workflow 2007 Custom Action Visual Studio 2005 Project Template. Troubleshooting References
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
4. 5.
6.
7.
Step 2 - Steps to Create an Action Prerequisites To write your own WF activity you will need the Visual Studio 2005 extensions for .NET Framework 3.0. See the Support Resources section. To use the Nintex Workflow 2007 custom action project, the Visual Studio Web Application project template must be installed. It is a part of Service Pack 1 for Visual Studio and also available as a standalone patch. Downloads and more information is available from here: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx. See the Support Resources section for Service Pack 1 details. All actions in Nintex Workflow are Windows Workflow Foundation activities (System.Workflow.ComponentModel.Activity). Any WF activity can be imported into Nintex Workflow 2007. Activities are developed using Microsoft Visual Studio, and the appropriate documentation should be referred to regarding development.
Creating the Adapter NW adapters must implement a number of Interfaces. These include:
Nintex.Workflow.Activities.Adapters.IActivityAdapter
www.nintex.com
connect.nintex.com
This interface contains members to specify how the action is displayed during workflow design.
Nintex.Workflow.Activities.Adapters.IActivityPreview
This interface contains members to specify how the action is displayed in preview views (e.g. the workflow start page, viewing from the site gallery).
Nintex.Workflow.Activities.Adapters.IActivityRunTime
This interface contains members to specify how the action is displayed when viewing the progress of a running workflow. To simplify development, the abstract base class Nintex.Workflow.Activities.Adapters.GenericRenderingAdapter is provided. This class implements all necessary interfaces and provides generic rendering logic suitable for most activities. This SDK only describes creating actions that inherit from this base class. The following methods must be overridden:
public override NWActivityConfig GetDefaultConfig(Guid listId)
This method is used to return the default configuration xml for the action
public override bool ValidateConfig(ActivityContext context)
This method returns a boolean indicating whether or not the adapter has a valid configuration xml for the WF activity.
public override NWActionConfig GetConfig(Activity a, List<Activity> supportingActivities, Hashtable ruleConfigs, Guid listId, WorkflowVariableCollection variables)
This method returns an NWActionConfig built from an existing configured WF activity. This is used when rendering from previously saved Xoml. e.g. The workflow progress page or a saved workflow.
public override CompositeActivity AddActivityToWorkflow(NWActionConfig config, RootWorkflowActivityWithData parentWorkflow, CompositeActivity parentActivity, RuleConditionReference condition, WorkflowVariableCollection variables)
This method is called when building a workfow. This creates an instance of the WF activity and inserts it into the parent workflow. It is here that the configuration is read and the values in it assigned to the WF activity.
public override ActionSummary BuildSummary(ActivityContext context)
This method specifies the contents of the summary box displayed during design and in the preview views of the workflow. The following method may be overriden:
public override ActionSummary BuildRuntimeSummary(ActivityRuntimeContext context)
This method specifies the contents of the summary box for when viewing a running workflow. By default it displays the same content as BuildSummary() with the addition of start and end timestamps.
Creating the Configuration Dialog To ensure UI consistency across all dialogs and to simplify development, a custom master page has been created (ActivityUIMasterPage.master). This master page includes necessary client scripts containing common functions used to manipulate the configuration xml. It is recommended that your custom dialog uses this master page and this document assumes this is the case. Add a reference to the master page by including the following declaration in the aspx page:
ASP.Net
www.nintex.com
connect.nintex.com
ASP.Net
<%@ Page MasterPageFile="/_layouts/NintexWorkflow/ActivityUIMasterPage.master"%>
For more information on the activity UI master page see the master page section in the SDK. Two JavaScript functions are required to retrieve and write configuration xml. These functions are called from the scripts included in the master page.
function TPARetrieveConfig()
This function must read the configuration xml and populate the controls in the dialog with the correct values.
function TPAWriteConfig()
This function must read values from the controls on the dialog and write them into the configuration xml. If you wish to perform input validation at this point you may do so and returning false from this function will prevent the dialog from closing, otherwise return true.
These functions have access to a global XML Dom object called configXml. This object contains the configuration xml for the action. These functions read and write values to the xml stored in this object and the script referenced in the master page handles the creation and persistence of the configXml object.
www.nintex.com
connect.nintex.com
The action will now appear in the designer. Note that the import process automatically creates a SafeAction element in the web.config. SharePoint requires workflow activities to be registered as safe before they can be used in declarative workflows.
www.nintex.com
connect.nintex.com
What the template includes The project template will create the following directory and file structure: <projectname> <projectname>\<projectname>.csproj <projectname>\<projectname>.nwa <projectname>\<projectname>Dialog.aspx <projectname>\<projectname>Dialog.aspx.cs <projectname>\ App_Code\<projectname>Adapter.cs <projectname>\ images\<projectname>Activity.png <projectname>\ images\<projectname>ActivitySmall.png <projectname>\ images\<projectname>ActivityWarning.png <projectname>\ properties\AssemblyInfo.cs This includes a base configuration dialog, WF activity class, adapter class, default icons for the action and a .nwa action import file. The.nwa file defines all the information required to import the new Nintex Workflow 2007 Action into SharePoint Central Administration. After building and signing the assembly, the activityAssembly and adapterAssembly elements must be populated.
<activityAssembly>MyWorkflowAction, Version 1.0.0.0, Culture=neutral, PublicKeyToken=12345678901234567</activityAssembly>
www.nintex.com
connect.nintex.com
Step 5 References Configuration XML When reading the configXml in JavaScript, the xml will resemble the following example. Nintex Workflow Xml <NWActionConfig LCustLbl="false" RCustLbl="false" TCustLbl="false" BCustLbl="false"> <BLabel></BLabel> <LLabel></LLabel> <RLabel></RLabel> <TLabel>Workflow action name</TLabel> <ExpectedDuration>-1</ExpectedDuration> <Assembly>MyCompany.MyWorkflowActions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx</Assembly> <Type>MyCompany.MyWorkflowActions.MyAdapter</Type> <IsValid>true</IsValid> <ConditionUse>None</ConditionUse> <Parameters> <Parameter Name="x"> <PrimitiveValue Value="Some Value" ValueType="Text"/> </Parameter> <Parameter Name="y"> <Variable Name="A Workflow Variable" Type="Text"/> </Parameter> </Parameters> <FieldReferences> <FieldReference Name="Field Name" Value="" Type=""> <PrimitiveValue Value="Some Value" ValueType="Text"/> </FieldReference> </FieldReferences> </NWActionConfig>
www.nintex.com
connect.nintex.com
Nintex Workflow Xml <Parameter Name="x"> <PrimitiveValue Value="Some Value" ValueType="Text"/> </Parameter>
The child node of Parameter (and FieldReference) can be a PrimitiveValue or a Variable to represent a workflow variable. Using the correct value nodes allow for the use of helper methods in building the workflow to assist in automatically interpreting the configuration xml.
www.nintex.com
connect.nintex.com
REQUIREMENTS
Windows SharePoint Services 3.0 Nintex Workflow 2007 Visual Studio 2005 Extensions for the .NET Framework 3.0 Visual Studio 2005 Service Pack 1
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. 3. 4. Building the Workflow Foundation activity Building the Nintex Workflow adapter Building the configuration dialog Importing into Nintex Workflow
SUPPLIED SAMPLES
This example contains the completed Visual Studio solution for the Nintex Workflow SQL action. Also as a part of this example Nintex Workflow has developed a custom Visual Studio 2005 project template to aid in the development process of actions for Nintex Workflow. To deploy the Nintex Workflow Action Visual Studio project template copy the supplied zip file to you Visual Studio Project Templates (Visual C#) folder. This location of this folder can be found in your Visual Studio preferences (Tools -> Options -> Project and Solutions -> Visual Studio user project template location). Solutions 1. 2. {SDK Location}\Examples\ExecuteSqlAction {SDK Location}\support\NW2007ActionProjectTemplate
www.nintex.com
connect.nintex.com
2.
Add a Workflow Activity Library to the solution, and rename the default Activity1.cs to ExecuteSqlActivity.cs
3.
Prepare project: Enter the code view by pressing F7 on ExecuteSqlActivity.cs. Change the class to inherit from Activity instead of SequenceActivity because we will be writing code directly into the Execute method. Change the namespace to MyCompany.WorkflowActions. Tip when changing the namespace make sure you update the *.Designer.cs file also (this is a partial class).
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
namespace MyCompany.WorkflowActions { public partial class ExecuteSqlActivity: Activity { public ExecuteSqlActivity() { InitializeComponent(); } } }
4.
Add Dependency Properties to the activity: Dependency Properties are object properties that can be bound to other elements of a workflow such as workflow variables. We use them to store the data that the activity will require or to output data from the activity. This activity will use seven Dependency Properties. ConnectionStringProperty and SqlQueryProperty store the configurable information for this activity. ResultOutputProperty will save any result into a workflow variable. __ListItemProperty, __ContextProperty and __ListIdProperty are properties included in most SharePoint activities. They provide context about the list and item that the workflow is running on. CurrentWorkflowVariableValuesProperty is used by Nintex Workflow to provide a Hashtable of workflow variable names and values to the activity. The Dependency Properties are declared as members of the ExecuteSqlActivity class:
www.nintex.com
connect.nintex.com
Each dependency property must also be exposed as a public property; the following shows the property implementation of the __ContextProperty:
C# [ValidationOption(ValidationOption.Required), Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public WorkflowContext __Context { get{ return (WorkflowContext)base.GetValue(ExecuteSqlActivity.__ContextPrope rty); } set{ base.SetValue(ExecuteSqlActivity.__ContextProperty, value); } }
www.nintex.com
connect.nintex.com
The Execute method of this activity implements simple data access code: C# using(SqlConnection conn = new SqlConnection(ConnectionString)) using(SqlCommand command = new SqlCommand()) { command.Connection = conn; command.CommandType = CommandType.Text; command.CommandText = SqlQuery; conn.Open(); object result = command.ExecuteScalar(); if(result != null) this.ResultOutput = result.ToString(); } return ActivityExecutionStatus.Closed;
Note: The values are retrieved from the Dependency Properties by calling the implemented property. Also note the ResultOutput is being assigned to. Any workflow variable that is bound to ResultOutput will now contain the value of result. 6. Add a check that the action is allowed to run in workflows. This is a security measure that will cause the workflow to fail if the action is not allowed on the site the workflow is running on. C# ActivityActivationReference.IsAllowed(this.GetType(), __Context.Web);
7.
Add runtime context data: To provide more flexibility when configuring the SQL query, we want to enable lookups to context data. Context data consists of workflow variables, list item properties and other common data such as the user that initiated the workflow. In NW, lookups are done by using tags in a string. For example, {ItemProperty:Title} in a string is replaced at runtime with the title of the item that the workflow is running on. Formats for these references are: {ItemProperty:internalFieldName} properties of the item the workflow is acting on. {WorkflowVariable:variableName} workflow variables.
www.nintex.com
connect.nintex.com
The activity is responsible for replacing the reference tags with actual values. Reference replacement is done by constructing an NWContext object and calling the AddContextDataToString method as shown here.
C# NWContext ctx = new NWContext(this.__Context, new Guid(this.__ListId), this.__ListItem, this.WorkflowInstanceId, CurrentWorkflowVariableValues, this); // Replace any inserted property references // (Common, ItemProperties and WorkflowVariables) with the current value. string sqlQuery = ctx.AddContextDataToString(SqlQuery, true);
The NWContext object is constructed using context information from the workflow provided through the dependency properties. In this case the code is replacing any references in the SqlQuery property. The result from this method should then be passed in to command.CommandText. 8. Handle exceptions: The final code in the activity is to handle any exceptions. This is done by overriding HandleFault. C# protected override ActivityExecutionStatus HandleFault(ActivityExecutionContext executionContext, Exception exception){}
To handle any exception that is thrown during execution. The following code will log the exception message to the workflow history list. C# ISharePointService spService = (ISharePointService)executionContext.GetService( typeof(ISharePointService)); spService.LogToHistoryList(this.WorkflowInstanceId, SPWorkflowHistoryEventType.WorkflowError, -1,
www.nintex.com
connect.nintex.com
9.
Sign the assembly: Workflow activities used by NW must be installed into the Global Assembly Cache. Therefore the assembly must be strongly named. To sign the assembly: Right click on the project, choose Properties from the menu and select the Signing page. Choose Sign the assembly and create a new key.
Step 2 - Building the Nintex Workflow adapter Nintex Workflow uses adapters to control how each WF Activity is rendered and configured. 1. Create an adapter project Add a new Nintex Workflow 2007 Action project to the solution. The template is found under My Templates in the Visual C# category.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
This method defines the parameters that can be configured for this action. In this case, a parameter is needed for the Connection String, Sql Query and Result properties of the ExecuteSqlActivity class. 3. Define global constant names for each property C# const string ConnectionStringProperty = "ConnectionString"; const string SqlQueryProperty = "SqlQuery"; const string OutputProperty = "Output";
4.
Create an ActivityParameter array Add an ActivityParameter object for each parameter to the array in the NWActionConfig object. C# c.Parameters = new ActivityParameter[3]; // Define the parameters that the user can configure for this action c.Parameters[0] = new ActivityParameter(); c.Parameters[0].Name = ConnectionStringProperty; c.Parameters[0].PrimitiveValue = new PrimitiveValue(); c.Parameters[0].PrimitiveValue.Value = string.Empty; c.Parameters[0].PrimitiveValue.ValueType = SPFieldType.Text.ToString(); c.Parameters[1] = new ActivityParameter(); c.Parameters[1].Name = SqlQueryProperty; c.Parameters[1].PrimitiveValue = new PrimitiveValue(); c.Parameters[1].PrimitiveValue.Value = string.Empty; c.Parameters[1].PrimitiveValue.ValueType = SPFieldType.Text.ToString(); c.Parameters[2] = new ActivityParameter(); c.Parameters[2].Name = OutputProperty; c.Parameters[2].Variable = new NWWorkflowVariable();
Each ActivityParameter has a name and a value. The value can either be a Primitive Value or a WorkflowVariable, defined by setting the corresponding property. Primitive Values represent a user-typed value, as opposed to binding to a workflow variable.
www.nintex.com
connect.nintex.com
This method defines when the configuration is in a state that the action can be published. The custom logic can check for anything; however there are some inbuilt methods for making sure the value entered is of the correct type. 6. Add a dictionary of ActivityParameterHelpers to assist validation C# Dictionary<string, ActivityParameterHelper> parameters = context.Configuration.GetParameterHelpers();
7.
You can then validate that the connection string is not blank by checking it is a not an empty string value: C# if (!parameters [ConnectionStringProperty].Validate( typeof(string), context)) { isValid &= false; validationSummary.AddError("Connection String", ValidationSummaryErrorType.CannotBeBlank); }
The validationSummary member defines what is displayed in the mouse over popup for an invalid action. Each validation fault is added to the validationSummary to inform the user. 8. Override AddActivityToWorkflow C# public override CompositeActivity AddActivityToWorkflow(NWActionConfig config, RootWorkflowActivityWithData parentWorkflow, CompositeActivity parentActivity, RuleConditionReference condition, WorkflowVariableCollection variables){}
This method assigns the values from the configuration to a new instance of the activity that the adapter is responsible for
www.nintex.com
connect.nintex.com
10. Assign values from the configuration Here you can use a Dictionary of ActivityParameterHelpers to assist in assigning values. The AssignTo method wraps handling of details such as whether to bind a workflow variable or set a primitive value. C# Dictionary<string, ActivityParameterHelper> parameters = config.GetParameterHelpers(); parameters[ConnectionStringProperty].AssignTo(a, ExecuteSqlActivity.ConnectionStringProperty, parentWorkflow, parentActivity, variables); parameters[SqlQueryProperty].AssignTo(a, ExecuteSqlActivity.SqlQueryProperty, parentWorkflow, parentActivity, variables); parameters[OutputProperty].AssignTo(a, ExecuteSqlActivity.ResultOutputProperty, parentWorkflow, parentActivity, variables);
11. Set any additional properties If the activity requires additional context data that isnt user defined, this must be bound manually. In this example, the ExecuteSqlActivity uses standard SharePoint context data. C# a.SetBinding(ExecuteSqlActivity.__ContextProperty, new ActivityBind(parentWorkflow.Name, StandardWorkflowDataItems.__context)); a.SetBinding(ExecuteSqlActivity.__ListItemProperty, new ActivityBind(parentWorkflow.Name, StandardWorkflowDataItems.__item)); a.SetBinding(ExecuteSqlActivity.__ListIdProperty, new ActivityBind(parentWorkflow.Name, StandardWorkflowDataItems.__list));
www.nintex.com
connect.nintex.com
12. Persist labels and expected duration to the activity These properties are common to all activities and are stored in a seralized ActivityFlags object in the activitys description property. Description is a member of the base activity class so there are no special requirements to the store this data. C# ActivityFlags f = new ActivityFlags(); f.AddLabelsFromConfig(config); f.AssignTo(a);
13. Add the activity to its parent and return. Remember to add the activity to the parentActivity not the parentWorkflow. This ensures that the ordering of activities is correct. C# parentActivity.Activities.Add(a); return null;
14. Override GetConfig C# public override NWActionConfig GetConfig(Activity a, List<Activity> supportingActivities, Hashtable ruleConfigs, Guid listId, WorkflowVariableCollection variables){}
This method populates an NWActionConfig object from an existing activity object. It involves reading the properties of an activity and storing the values in the configuration object.
www.nintex.com
connect.nintex.com
16. Retrieve the values from the activity. A dictionary of ActivityParameterHelpers assists when working with Dependency Properties: C# Dictionary<string, ActivityParameterHelper> parameters = c.GetParameterHelpers(); parameters[ConnectionStringProperty].RetrieveValue(a, ExecuteSqlActivity.ConnectionStringProperty, listId, variables); parameters[SqlQueryProperty].RetrieveValue(a, ExecuteSqlActivity.SqlQueryProperty, listId, variables); parameters[OutputProperty].RetrieveValue(a, ExecuteSqlActivity.ResultOutputProperty, listId, variables);
17. Retrieve the labels for the UI. C# ActivityFlags f = ActivityFlags.GetFlags(a); c.SetLabels(f);
18. Update the IsValid flag to reflect the retrieved configuration. C# c.IsValid = ValidateConfig(new ActivityContext(listId, ActivityReferenceCollection.FindByAdapter(this), c));
This method defines what is visible in the mouse over popup summary of the action. It should provide a brief summary of what the action will do. The ActionSummary takes a string that will be rendered. This example includes the connection string value to provide some contextual information.
www.nintex.com
connect.nintex.com
2.
Design the web form. Add html controls that will allow users to enter values for each parameter. You can ensure consistent styling by using the styles included in the master page. The following html provides a text control for the sql connection string, a textarea for the sql query and a select list to choose a variable to store the activity output in. ASP.Net <div class="RowBlue"> <span class="Label req">Connection String</span> <input type="text" class="InputWidth" id="connectionString" /> </div> <div class="RowBlue"> <span class="Label req">SQL Query</span> <textarea type="text" class="InputWidth" rows="30" id="sqlQuery"></textarea> </div> <div class="RowBlue"> <span class="Label">SQL Query</span> <select id="resultOutput" class="InputWidth"></select> </div>
3.
Add script to populate the dialog. JavaScript is used to read and write to and from the configuration xml to the input controls. The xml is stored in a global object call configXml. TPARetrieveConfig reads values from configXml into the input controls. TPAWriteConfig takes values from the input controls and stores them in configXml. External script that is included in the master page initially populates configXml and persists it when the dialog is saved. Declare global variables for the objects:
www.nintex.com
connect.nintex.com
TPARetrieveConfig runs when the dialog opens, so add code to first set the control variables: JavaScript connectionStringCtrl = document.getElementById("connectionString"); sqlQueryCtrl = document.getElementById("sqlQuery"); resultOuputCtrl = document.getElementById("resultOutput");
To allow the user to select from the list of variables that are defined, the resultOutputCtrl selection box must be populated with available choices. The JavaScript function ListWorkflowVariables will retrieve an xml node list of the variables that have been defined. In this case, we will filter the list to only show text variables. JavaScript var workflowVariables = ListWorkflowVariables(); for(var i=0; i<workflowVariables.length; i++) { if(workflowVariables[i].getAttribute("Type") == "Text"){ resultOuputCtrl.options[resultOuputCtrl.options.length] = new Option(workflowVariables[i].getAttribute("Name"), workflowVariables[i].getAttribute("Name"));} }
Now the controls are ready, the existing configuration values can be read from configXml. JavaScript connectionStringCtrl.value = configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name ='ConnectionString']/PrimitiveValue/@Value").text; sqlQueryCtrl.value = configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name ='SqlQuery']/PrimitiveValue/@Value").text; resultOuputCtrl.value = configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name ='Output']/Variable/@Name").text;
4.
Add script to save the configuration. TPAWriteConfig is called when the save button for the dialog is pressed. This function is responsible for modifying configXml with the values entered by the user. If custom validation is required, returning false will prevent the dialog from closing.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
Step 4 - Importing into Nintex Workflow The following steps import the action into NW. 1. Complete the NWA import file. The project includes a .nwa file for importing actions into Nintex Workflow. This file contains xml defining the information that NW requires to install the action. You will need to update the name, category, description and full assembly and type names for the adapter and activity. 2. Deploy the action files Both the activity and adapter assemblies must be deployed to the GAC.
The dialog page and icons must be placed in the CustomActions folder in the Nintex Workflow layouts folder in SharePoint.
www.nintex.com
connect.nintex.com
Choose the Import Workflow Action link. A dialog box will show to allow selection of the .nwa file. Once imported, expanding Show Details will show the information that has been imported.
Press the OK button at the bottom of the page to import the action. The list of actions will display with the Execute Sql custom action in it.
Check the enable checkbox and press ok. Reset IIS. 4. Try it! The workflow action is now completed and ready for use in a workflow.
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. 3. 4. 5. Create a custom Content Type Create a custom form Deploy the custom form Update content type to use the custom form Configure the workflow
RESOURCES
There is an example Visual Studio project in the Examples\CustomTaskForm folder. This contains a completed task form with the same look and feel as the out of the box task response form. It can be used as a base for modifications.
www.nintex.com
connect.nintex.com
3. 4. 5. 6.
Select the "Create button at the top of the existing content types list. Enter a name and description of the content type. Under Parent Content Type, select Nintex Workflow for the group and Nintex Workflow Task for the parent content type. Press Ok to complete creating the content type.
www.nintex.com
connect.nintex.com
This information is used to open the task item, as shown in the following code: C# int spTaskItemID = int.Parse(Page.Request.QueryString["ID"]); Guid taskListId = new Guid(Page.Request.QueryString["List"]); SPListCollection lists = SPContext.Current.Web.Lists; lists.ListsForCurrentUser = true; SPList taskList = lists.GetList(taskListId, false); SPListItem spTask = taskList.GetItemById(spTaskItemID);
To respond to a task, set the decision and comments fields. These fields are a part of the base Nintex workflow task content type: C# int decision = 0; string comments = ""; Guid commentsFieldId = new Guid("{819E6CF2-36C3-4013-8AEF-C99712C26036}"); Guid decisionFieldId = new Guid("{A7AE99D0-E5DF-47f4-9D75-560E3F608006}"); spTask[decisionFieldId] = decision; spTask[commentsFieldId] = comments; spTask.Update();
If you have a reference to Nintex.Workflow.dll, the field id GUIDs are defined in constants found at:
www.nintex.com
connect.nintex.com
The valid values for the decision are: Outcome Approved Rejected Continue (for review tasks) Value 0 1 5
These are defined in the enumeration Nintex.Workflow.HumanApproval.Outcome 2. The NintexTask class Further functionality can be gained by adding reference to the assembly Nintex.Workflow.dll. The class Nintex.Workflow.HumanApproval.NintexTask stores information about the approval or review task of which the actual SharePoint task item is a part. The following code retrieves the NintexTask object that corresponds to the SharePoint task item. C# NintexTask task = NintexTask.RetrieveTask(spTaskItemID, SPContext.Current.Web, taskList);
The task can either be an ApprovalTask or a ReviewTask object which both inherit from NintexTask. These objects contain information about the workflow, the item that the workflow is running on and all the users that have been designated as approvers/reviewers.
3.
The ItemProperties server control The Nintex.Workflow.ServerControls.dll contains an ItemProperties server control. This server control renders all the properties of the workflow item, respecting the View specified in Central Administration. With an ItemProperties control on the aspx page, it can be set up with the following code: C# SPList list = lists.GetList(task.WFContext.ListID); SPListItem item = list.GetItemById(task.WFContext.ItemID) itemProperties.Item = item; itemProperties.InstanceID = task.WFContext.InstanceID;
www.nintex.com
connect.nintex.com
Procedure 4 Update content type to use the custom form SharePoint provides no user interface for updating the form of a content type. It must be done through code. The code to update the edit form of a content type is as follows: C# using(SPSite s = new SPSite(teamsite)) using (SPWeb web = s.OpenWeb()) { SPContentTypeCollection contentTypes = web.ContentTypes; SPContentType ct = contentTypes[contenttypename]; ct.EditFormUrl = formurl; ct.Update(); }
Note that if you do this in a HTTP request, you must set web.AllowUnsafeUpdates to true. Alternatively, Nintex Workflow 2007 ships with a command line administration application called nwadmin.exe, which supports setting the edit form for a content type. nwadmin.exe is located in the Nintex Workflow installation directory, by default this is [ProgramFiles]\Nintex\Nintex Workflow 2007. The command arguments: nwadmin.exe -o SetTaskForm -siteUrl <Url of the team site> -contentType <name of the content type> -taskformUrl <Url to the form> [-formType Edit|View|All] <which form type to update> [-updateChildren Yes|No] <whether or not to update content types that inherit from the target content type, including where the content type has been associated to a list) Example: The following command would be used for these values: The custom task page is called CustomTaskForm.aspx and is deployed to c:\program files\common files\microsoft shared\web server extensions\12\template\layouts\NintexTaskForms on the web server The SharePoint site that the content type was added to is http://companyportal.com/sites/finance The content type that inherits from NintexWorkflow Task is called Finance Workflow Task
www.nintex.com
connect.nintex.com
When the workflow is published, the content type will automatically be added to the task list used in the workflow.
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 Build 11001 or later
RESOURCES
There is an example Visual Studio project in the Examples\CustomTaskForm folder. This contains a completed task form with the same look and feel as the out of the box task response form. It can be used as a base for modifications. The example code handles Flexi task, Approval and Review actions.
www.nintex.com
connect.nintex.com
Note: If you custom task response form can handle approval and Flexi tasks, you will need to create two custom content types. One has a parent of Nintex Workflow Task for use in the Request Approval action, one has a parent of Nintex Wokrflow Multi Outcome Task for use in Flexi Task actions. Once the task form is deployed, it can be assigned as the edit form for both content types. Registering a task response Responding to a Flexi task uses the same fields as an approval task: C# Using Nintex.Workflow.Common; // Available in Nintex.Workflow.dll
C# int decision = 0; string comments = ""; SPListItem spTask =// Retrieve task item from query string values spTask[NWSharePointObjects.FieldDecision] = decision; spTask[NWSharePointObjects.FieldComments] = comments; spTask.Update();
However, the Nintex.Workflow.HumanApproval.Outcome enum is not used for the decision value in a Flexi task. Configured Outcomes The value that is provided for the task outcome is an integer ID representing one of the outcomes that was configured in the Flexi task action configuration dialog. Each possible outcome is represented as a Nintex.Workflow.HumanApproval.ConfiguredOutcome object.
www.nintex.com
connect.nintex.com
Note: The AvailableOutcomeInfo property of the Approval object will throw an exception if the parent NintexTask object is not a MultiOutcomeTask object (which represents a Flexi task). Each item in the collection should be presented to the user, and the ID of the selected ConfiguredOutcome provided to the Decision field of the task. Displaying the outcomes The Nintex task form, and the task form code examples, use a user control called ConfiguredOutcomePanel to display the possible outcomes to the user as radio buttons. See the example project for details on its use. Your custom task form should perform checks to determine if comments for the selected outcome are required, and implement appropriate validation. The ConfiguredOutcome object has a property called CommentsMode to indicate whether comments were specified as required, optional or not applicable. Deploying the custom form and associating it with the custom content type. See procedures 3 and 4 in the previous section How to: Create a custom task response form.. The instructions are the same. Configure the workflow In the workflow designer, drag on a Assign a Flexi task action and configure it. If additional usable content types are detected, a drop down list will be displayed allowing you to select the custom content type.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 Compatible XSLT editor
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. Preparation Build Workflow
SUPPLIED EXAMPLES
This example contains two Xslt files. Each transforms the Xml returned from the Nintex Workflow web service and formats it into user friendly text. The first file outputs plain text to be used when writing to a plain text column in SharePoint, the second file outputs to a rich text Html column. Files 1. 2. {SDK Location}\Examples\ExportWorkflowHistory\HistoryExportPlain.xsl {SDK Location}\Examples\ExportWorkflowHistory\HistoryExportRich.xsl
www.nintex.com
connect.nintex.com
8. From the Settings link on the toolbar click Create Workflow. 9. In the workflow designer add a Log in the history list action to the blank workflow. 10. Configure the action and enter This is a Nintex Workflow SDK example, then click Save. 11. Next add a Delay for action under. 12. Configure the action and enter 1 into the minute field, then click OK. 13. From the toolbar click Settings -> Workflow Variables. 14. Type workflowHistory in the Name field. 15. Select Text as the variable type, and click Create and then Save.
Figure: Workflow varibable workflowHistory. 16. Add a Call web service action (in the integration category). 17. Configure the call web service action: a. Set the URL to {Common:WebUrl}/_vti_bin/nintexworkflow/workflow.asmx, b. Set the credentials. c. Click the refresh button next to the web method and you will be prompted to confirm the url. Once confirmed, this will contact the web service and retrieve all the available methods. d. Select GetWorkflowHistory as the web method.
www.nintex.com
connect.nintex.com
f. g. h. i.
Click XSL Transform and enter in you XSL code (see supporting files) Store the results in the workflow variable workflowHistory. Set the results format field to Xml. Save the configuration.
www.nintex.com
connect.nintex.com
Figure: Update an item workflow action settings. 21. From the toolbar click Actions -> Publish. 22. Enter Nintex Workflow SDK Export Example as the workflow name and click Save.
Figure: The constructed workflow. To test the workflow: 1. 2. 3. 4. Navigate back to the Shared Documents library. Create a new document and save it into the library. From the new document's context menu select Workflows. On the Workflows page click Nintex Workflow SDK Export Example, and then click Start.
www.nintex.com
connect.nintex.com
Figure: Library view of output from the Nintex Workflow SDK Export Example workflow.
Tip: The web service method GetWorkflowHistory requires a SPWorkflowState enumeration value. Below is a list of valid values. You can also find this information when viewing WSDL for the method (for example {weburl}/_vti_bin/nintexworkflow/workflow.asmx?op=GetWorkflowHistory) Tip: this example has been configured to work against a library, if you wished to collect the workflow history for a list item you need to change the web service methods to GetWorkflowHistoryForListItem, which instead of a file Url it requires a item Id and list name. GetWorkflowHistoryForListItem can also be used with a document library to access a file by its ID. Tip: To view the raw information returned from the web service clear the web service call action XSL Transform field, this will then store the raw XML into the workflow variable. SPWorkflowState Values Running Completed Cancelled Faulting Terminated All
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 BizTalk Server 2006 Visual Studio 2005 (with BizTalk templates)
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. 3. 4. 5. Preparing Nintex Workflow Create the Orchestration Publish the Orchestration web service Configure the application in BizTalk Server Administration Complete the workflow configuration
www.nintex.com
connect.nintex.com
2.
Add a Send Receive BizTalk action. The Send / Receive BizTalk action is available in the Integration panel.
www.nintex.com
connect.nintex.com
Step 4:
4.
Export the message schemas. Nintex workflow automatically generates xsd files to represent the data that has been selected to send and receive. The xsd will consist of an xml node for each data item. Choose both Export XSD links to download the schema for the send message and the receive message.
www.nintex.com
connect.nintex.com
Procedure 2 Create the Orchestration 1. Create a new BizTalk project in Visual Studio.
2.
Add the schema files that were exported from Nintex Workflow to the project.
www.nintex.com
connect.nintex.com
4.
Add a receive port. This is the receive port that Nintex Workflow will send messages in to. Right click on the receive port surface and choose New Configured Port to start the Add port wizard.
When asked, specify Public No Limit as the access restriction. Later, we will publish this Orchestration as a Web Service, and only public ports can be exposed.
www.nintex.com
connect.nintex.com
6.
www.nintex.com
connect.nintex.com
You will also need an active receive message action and a send message action to be hooked up to the ports. The message content data that is required in your orchestration must be promoted.
www.nintex.com
connect.nintex.com
8.
Deploy the application. Sign the application assembly, define a name for the application and deploy it to your BizTalk server.
Procedure 3 Publish the Orchestration web service 1. Star the BizTalk Web Services Publishing Wizard.
Note: the web services publishing wizard is only available on machines that have Visual Studio installed.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
Configure the properties of the location and change the Receive Pipeline drop down to XMLReceive. This is required for the BizTalk engine to be able to read the xml to determine what time of message it has received.
Enable the port. 2. Configure a send port. Nintex Workflow exposes a http handler to receive messages from BizTalk as post data. Create a new send port and specify HTTP as its type.
www.nintex.com
connect.nintex.com
Enable the send port. 3. Bind ports to the orchestration. Select the orchestration from the orchestrations section
Set the correct host and the physical ports that have been defined in this section for the orchestrations logical ports.
4.
www.nintex.com
connect.nintex.com
Save the action. 2. Use the data. The variable created to hold the data will be populated after the BizTalk action has been completed and can be used in the same way as any other piece of workflow data. For example, if can be used in the body of an email.
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 Compatible CSS editor Visual Studio 2003/2005/2008 (optional) Microsoft Internet Explorer Developer Toolbar (option)
SUMMARY
This is a quick summary of the steps and procedures required to complete this example. 1. 2. 3. Creation of CSS Message template branding Configure SharePoint to use new styling.
SUPPLIED EXAMPLES
This example contains a Visual Studio 2005 solution for a sample console application which set a webs alternate CSS URL. Solutions 1. {SDK Location}\Examples\AltCssApp
www.nintex.com
connect.nintex.com
Procedure 2 Message template branding Nintex Workflow uses a configurable messages template (a header and a footer) for all email notifications. There are different levels in which these templates can be controlled and customized: Farm level Site collection level Web level
Note: When an email message is sent by Nintex Workflow it will first check for a template at the teamsite level, if none is defined it will check the site collection level and if none is defined there, the farm template will be used. This give you a wide range of branding options for email messages. Messages templates for a teamsite and site collection are edited from the Site Settings panel on a teamsite. Farm level templates are defined in SharePoint Central Administration. Procedure 3 Configure SharePoint to use new styling There are two methods of branding SharePoint. The first is with a theme which can be very restricted in terms of management on a wide scale. We will be talking about the second option which uses the alternative CSS feature. This feature allows you to specify a single CSS file which will be included in all web pages in a team site (via the master page). The alternate CSS for a team site can be controlled by two methods. The first is only valid if you have Microsoft Office SharePoint Server 2007 (MOSS), and the second is via code which is required for Windows SharePoint Services 3.0 (WSS). Please see the below detailed steps for your environment. Please note that the WSS 3.0 method will work in a MOSS 2007 environment as well. Microsoft Office SharePoint Server 2007 Alternate CSS 1. 2. 3. 4. 5. 6. 7. 8. 9. Open your browser to your site collection root (top level site). Create a new library called Styles Upload you CSS file to this library. Browse to the team site requiring branding Browse to the site settings page. Under the heading Look and Feel click Master Page In the section Alternate CSS URL select Specify a CSS file to be used by this publishing site and all sites that inherit from it. Click the Browse button and browse to the location where you uploading your CSS file in step 3. Click OK to select the CSS file, and then click OK to save the changes.
www.nintex.com
connect.nintex.com
Compile and run the console application, your team site alternative CSS will be updated.
www.nintex.com
connect.nintex.com
Note: to add a static value that does not need code to generate, consider using a workflow constant.
REQUIREMENTS
Nintex Workflow build 10828 or greater allows the addition of custom data items.
Inherit from ICommonDataItem public class InitiatorEmailAddressDataItem : Nintex.Workflow.ICommonDataItem 3. Implement the DisplayName and InternalName properties. DisplayName is the value shown in the reference inserter dialog, while InternalName is the value stored when the value is inserted.
Implement Properties public string DisplayName { get { return "Initiator's Email Address"; } } public string InternalName { get { return "InitatorEmailAddress"; } }
4.
Implement the GetValue method. This method is called at runtime to replace the token with an actual value. The method is passed a context object containing information about the workflow that is running. This example returns the email address of the user that initated the workflow
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
REQUIREMENTS
Nintex Workflow build 10828 or greater. Knowledge of creating a custom action for Nintex Workflow is assumed.
Implement Dependency Properties [ValidationOption(ValidationOption.Optional), Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public bool CaptureErrors { set { base.SetValue(CaptureErrorsProperty, value); }
www.nintex.com
connect.nintex.com
The following code demonstrates how to structure error handling within the activity execution to use the error handling options. Handle error in execution try { // do activity execution code if (CaptureErrors) ErrorOccurredOutput= false; return ActivityExecutionStatus.Closed; } catch (Exception ex) { if (CaptureErrors) { ErrorOccurredOutput = true; ErrorMessageOutput = ex.Message; return ActivityExecutionStatus.Closed; }
www.nintex.com
connect.nintex.com
Add the following code in the AddActivityToWorkflow method to save the values selected in the error handling panel. In this code snippet, config is the NWActionConfig object. The Dependency Properties are those defined in the previous section. AddActivityToWorkflow if (config.ErrorHandling != null) { config.ErrorHandling.AssignTo(a, MyActivity.CaptureErrorsProperty, MyActivity. ErrorOccurredOutputProperty, MyActivity.ErrorMessageOutputProperty, variables, parentWorkflow); }
Add the following code to GetConfig to retrieve the error handling settings. GetConfig config.ErrorHandling = ErrorHandling.BuildFrom(a, MyActivity.CaptureErrorsProperty, MyActivity.ErrorOccurredOutputProperty, MyActivity.ErrorMessageOutputProperty, variables);
The adapter can now handle assigning and retrieving the settings for the error handling panel.
www.nintex.com
connect.nintex.com
Then add an instance of the control to the page. Note that to keep the JavaScript simple, only one instance of the control can be used on a page. Add the ErrorHandlingConfig control <Nintex:ErrorHandlingConfig runat="server" id="errorHandlingConfig1"></Nintex:ErrorHandlingConfig> The control includes some of the common styles used in the action dialogs.
These JavaScript functions are defined as a part of the control. You should now be able to use the error handling panel in the custom action.
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Nintex Workflow 2007 build 10902 or greater Visual Studio 2008
SUMMARY
Using a SPFeatureReceiver class, the FeatureActivated method is overridden to provision a new SharePoint list and associate a Nintex Workflow. To do this, the Nintex Workflow web service method PublishFromNWF is called. Optionally, you could also override FeatureDeactivating to delete the workflow and the provisioned list.
SUPPLIED EXAMPLES
This example contains a Visual Studio 2008 solution demonstrating using a SharePoint feature and solution package to deploy a Nintex workflow. Solutions 1. {SDK Location}\Examples\WorkflowFeature
COMPONENTS
Feature.xml
www.nintex.com
connect.nintex.com
Workflow.nwf This is a Nintex Workflow export file. After desiging a Nintex Workflow, from the Actions menu in the designer, click Export.
DeployWorkflow.cs
This class file contains the SPFeatureReciever class used to provision a SharePoint list and deploy the Nintex Workflow. There are several constants at the top of this class that should be updated for your solution. In particular, the workflow name and the target list name. Authentication
www.nintex.com
connect.nintex.com
DEPLOYMENT
To deploy this solution, copy the output WSP file to your SharePoint server. Using stsadm.exe you can install and deploy the solution package. Stsadm.exe -o addsolution -filename myworkflowfeature.wsp stsadm.exe -o deploysolution -name myworkflowfeature.wsp -immediate -allowgacdeployment
www.nintex.com
connect.nintex.com
REQUIREMENTS
This example requires the following technologies and/or applications: Windows SharePoint Services 3.0 Visual Studio 2008
SUMMARY
A SharePoint solution package is used to deploy the required files for the workflow action and a web application scoped feature is used to register the custom action with Nintex Workflow. An event receiver attached to the feature performs the steps required to add and activate the action with Nintex Workflow: 1. 2. 3. Register the action with Nintex Workflow Enable the action to be used in the workflow designer for the farm Add entries to the web.config file for the web application to authorize the activity class with SharePoint
A simple custom action that writes entries to the server application event log is used for this demonstration.
SUPPLIED EXAMPLES
This example contains a Visual Studio 2008 solution demonstrating using a SharePoint feature and solution package to deploy a custom workflow action. Solutions 2. {SDK Location}\Examples\DeployWorkflowAction
COMPONENTS
The following components make up the supplied example.
www.nintex.com
connect.nintex.com
Custom Workflow Action To demonstrate installing a custom action, the project includes a very simple workflow action that writes to the SharePoint server event log. The following files are part of the action: Images\EventLogActionIcon.gif Images\EventLogActionIconSmall.gif Images\EventLogActionIconWarning.gif EventLogActionDialog.aspx EventLogActivity.cs EventLogAdapter.cs
For more information on creating a custom action see the chapters How To: Create a Custom Workflow Action Overview and How To: Create a Custom Workflow Action Step by Step Guide. Feature.xml This is a standard SharePoint feature definition. It is scoped to be activated on a web application. A SPFeatureReceiver class contains the code to install the action. The code is the equivalent of manually importing the nwa file and then activating the action for the entire farm. The feature also deploys an NWA file that contains the information about the action that Nintex Workflow requires. The unique identifiers highlighted in green should be regenerated for your feature and the sections highlighted in yellow should be updated to match your receiver assembly.
<Feature Id="{0A1558DE-676C-4615-9CC9-0F9E7D3BB799}" Title="Deploy Action Example" Description="An example feature used to deploy a custom workflow action" ReceiverAssembly = "CustomActions.EventLogAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7fc72706a49c89a6" ReceiverClass = "CustomActions.DeployActionExample.ActionInstaller" Version="12.0.0.0" Scope="WebApplication" xmlns="http://schemas.microsoft.com/sharepoint/"
www.nintex.com
connect.nintex.com
EventLogAction.nwa This is an xml file describing the components of the action. This file is read by the feature event receiver. ActionInstaller.cs This class file contains the SPFeatureReciever class used to register the custom action with Nintex Workflow. The feature activated and feature deactivated events are implemented. When the feature is activated for a web application, the workflow action will be visible in other web applications where the core Nintex Workflow feature has been activated. This is because registering a custom action in the Nintex Workflow database is a global operation. However, workflows using the custom action will not publish or run unless the feature is activated for the parent web application due to the dependency on an entry in the web.config file. When the feature is deactivated, it will remove the web.config entries for the web application. It will only remove the action from the workflow database if the feature is not activated on any other web application. DeployActionExample.wsp This file is created automatically by a post build event. This is the output WSP solution package. MakeCab.ddf This is the definition file for MakeCab.exe. There is a post build event on the project to call MakeCab.exe to produce the packaged WSP solution file. Manifest.xml This is the manifest file used in the SharePoint solution package. It refers to the feature and the assembly containing the SPFeatureReceiver class, as well as the individual content files that make up the custom action (images and aspx page). myKen.snk Strong name key file.
DEPLOYMENT
To deploy this solution, copy the output WSP file to your SharePoint server. Using stsadm.exe you can install and deploy the solution package. stsadm.exe -o addsolution -filename deployactionexample.wsp stsadm.exe -o deploysolution -name deployactionexample.wsp -immediate -allowgacdeployment
www.nintex.com
connect.nintex.com
Once the feature is activated you will be able to use the action in the workflow designer.
www.nintex.com
connect.nintex.com
REQUIREMENTS
Nintex Workflow build 10903 or greater.
When the function is invoked, the workflow will dynamically determine the required parameters, and attempt to parse what was provided in the workflow in to the correct data type. Overloads can also be used, as the workflow will match the number of parameters provided to the appropriate overload definition.
ALIASES
A function is referred to by its alias. A function can have multiple aliases. Localization of function names is done by adding a new alias for each language.
www.nintex.com
connect.nintex.com
DEFINED CLASSES
Selector ms-menutoolbar Description Preview
SmallActivityIcon
ms-quickLaunch
expanded
Defines the look of a workflow actions toolbar category in the expanded state. Defines the look of a workflow actions toolbar category in the collapsed state.
collapsed
ms-navheader divToolBoxActivity
www.nintex.com
connect.nintex.com
ActionDetailsPane
Defines the overall UI to the both the actions details information and warning panes.
ActionDetailsInfoHeader
ActionDetailsWarningHeader
ActionDetailsBody
RowBlue
Defines an alternating row colour on the action configuration interface. Defines an alternating row colour on the action configuration interface. Defines a label used in the action configuration screen.
RowWhite
Label
expandme
closeme NWDesignTimeCanvas Applied to the area in which a workflow is designed. Applied to the area in which a workflow is displayed on the start workflow page and when viewing a workflow from the workflow gallery. Applied to the area in which a workflow instance (e.g. a workflow in progress) is displayed.
NWPreviewCanvas
NWRuntimeCanvas
www.nintex.com
connect.nintex.com
NWDesignTimeAction
NWPreviewAction
NWStatisticsAction
NWRuntimeFutureAction
NWRuntimePastAction
NWRuntimePresentAction
NWRuntimeActionOverrideRed
SLStyles
www.nintex.com
connect.nintex.com
The following table describes the content placeholders contained in the ActivityUIMasterPage.
Tip: The ActivityUIMasterPage contains the required logic to integrate with the SharePoint help system. To override the default help page insert the following JavaScript, and replace helpItem with your own help index key. JavaScript var navBarHelpOverrideKey = 'helpItem';
For more information on developing and integrating into the SharePoint help system see http://www.codeproject.com/KB/sharepoint/CustomHelpPages_SP2007.aspx
www.nintex.com
connect.nintex.com
CREDENTIALS CONTROL
This control is used on action configuration dialogs to allow users to specify credentials. Users can either directly enter credentials, or select from credentials that have been defined in site settings. Nintex.Workflow.ApplicationPages.CredentialControl
PROPERTIES
Name CssClass Description Gets or sets the style sheet for the control text controls embedded in the control. Gets or sets the style sheet for the div element that the text controls are embedded in. Gets or sets display value for the control, possible values are normal or dialog. Use dialog when the control is being used on a action configuration dialog. Gets a Boolean value that specifies if control is using predefined credentials. Gets a string containing the password. Gets a integer that identifies the predefined credentials. Gets or sets whether to display a red asterisks to indicate the control is a required field. Gets a string containing the username. Get or set the width of the rendered field controls.
DialogContainerClass
DisplayMode
IsUsingPredefinedCredential
Username Width
METHODS
Name IsEmpty Description
SYNTAX
ASP.Net (Usage)
www.nintex.com
connect.nintex.com
JavaScript (Usage) // Set username value cc_setUsername(credentialPickerClientId, username); // Set password value cc_setPassword(credentialPickerClientId, password); // Retrieve username value var username = cc_getUsername(credentialPickerClientId); // Retrieve password value var password = cc_getPassword(credentialPickerClientId);
PREVIEW
REMARKS
For the correct styles to be applied to the rendered control, use a Nintex.Workflow.ServerControls.CssLink control and the Microsoft.SharePoint.WebControls.CssLink control on the page. When a predefined credential has been selected, the cc_getPassword will return an empty string and cc_getUsername will return a string representing the credential in the format {WorkflowConstants:credentialName}. This token is recognized when resolving the credentials at runtime with Nintex.Workflow.CredentialValue.DetermineRuntimeCredentials(). The following example demonstrates resolving credentials from within a workflow activity. The activity class has a string property for Username and a string property for Password. If the Username property contains a predefined credential token, the matching username and password will be returned. If Username does not contain a token, runtimeUsername and runtimePassword will contain the same values as entered by the user. C# (Determining runtime credentials) string runtimeUsername = string.Empty; string runtimePassword = string.Empty; Nintex.Workflow.CredentialValue.DetermineRuntimeCredentials(this.Username,
www.nintex.com
connect.nintex.com
CSS LINK
This control is used to add the style sheets associated with Nintex Workflow to a page. Add it to the <head> element of a web page. Nintex.Workflow.ServerControls.CssLink
SYNTAX
ASP.Net (Usage) <%@ Register Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" Namespace="Nintex.Workflow.ServerControls" TagPrefix="NWC" %> <NWC:CssLink id="cssLink1" runat="server"></NWC:CssLink>
DURATION SELECTOR
This control is used on action configuration dialogs to allow a duration value to be selected. The value is represented as the total minutes. Nintex.Workflow.ServerControls.DurationSelector
SYNTAX
ASP.Net (Usage) <%@ Register Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" Namespace="Nintex.Workflow.ServerControls" TagPrefix="NWC" %> <NWC:DurationSelector ID="DurationSelector1" runat="server" />
www.nintex.com
connect.nintex.com
REMARKS
Only one instance of this control can be included on a page. The position of the selector div can be overridden by including a JavaScript function called SetDurationPickerPosition that has one parameter representing the div object. The following example demonstrates how the default position is set: JavaScript (Setting the selector position) function SetDurationPickerPosition(oDiv){ var windowWidth = document.body.offsetWidth; var windowHeight = document.body.offsetHeight; var widthOfDiv = parseInt(oDiv.style.width); var heightOfDiv = parseInt(oDiv.style.height); var leftPos = (windowWidth - widthOfDiv) / 2; var topPos = (windowHeight - heightOfDiv) / 2; oDiv.style.left = leftPos + "px"; oDiv.style.top = topPos + "px"; }
ITEMPROPERTIES
This control displays properties for an item. Nintex.Workflow.ServerControls.ItemProperties
PROPERTIES
Name InstanceID Description Gets or sets the instance ID of the workflow that the item properties are being displayed for. If the InstanceID is not set, the workflow preview link will not display. Gets or sets the list item to display properties for. Gets or sets the source parameter to add to the url for the item the workflow is running on. Only applies for a list item, not a library item. Default is blank. Gets or sets the target attribute to add to the hyperlink that opens the item the workflow is running on. Default is _blank.
Item ItemLinkSource
ItemLinkTarget
www.nintex.com
connect.nintex.com
MultipleLookupsSeparator
ShowAttachments
ShowWorkflowItemLink
ShowWorkflowStatusLink
SYNTAX
ASP.Net (Usage) <%@ Register Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" Namespace="Nintex.Workflow.ServerControls" TagPrefix="NWC" %> <NWC:ItemProperties ID="itemProperties" runat="server"></NWC:ItemProperties>
REMARKS
If the list has a view that has the same name as Task form properties view option in the Nintex Workflow Global Settings then only properties included in that view will be displayed.
PROPERTIES
Name ApproverContext Description Gets or sets whether to include approver specific context items. This member is reserved for internal use; This value should be left as False. Gets or sets whether to list workflow constants that have been marked as sensitive to be listed in the possible references. The workflow action must also allow the user of sensitive constants for them to be successfully resolved. Gets or sets the style sheet for the control.
IncludeSensitiveWFConstants
CssClass1
www.nintex.com
connect.nintex.com
SYNTAX
ASP.Net (Usage) <%@ Register TagPrefix="NWC" TagName="PlainText" Src="~/_layouts/NintexWorkflow/PlainTextWebControl.ascx" %> <NWC:PlainText cssClass1="ms-input" runat="server" id="plainText1" width="100%" ></NWC:PlainText>
JavaScript (Usage) // Set value setPlainTextEditorText(textInserterClientId, value); // Retrieve value var value = getStringFromPlainTextEditor(textInserterClientId);
PREVIEW
REMARKS
Workflow variables will only be listed in a workflow configuration dialog. They are obtained from the dialogArgs object that is passed into the configuration dialog by the workflow designer. Item properties will only be displayed if a QueryString value called ListId is present. ListId must contain the ID of the list to display properties from.
www.nintex.com
connect.nintex.com
PROPERTIES
Name ApproverContext Description Gets or sets whether to include approver specific context items. This member is reserved for internal use; This value should be left as False. Gets or sets a value to specify if the reference selecting dialog will clear any existing values in the text box when a value is inserted. Gets or sets the type of LDAP browsing window to display open, possible values are HomeServer, LDAP or MailStore. The ShowLdapPickerButton property must be set to true for the LDAP browse button to display. Gets or sets a value to filter the values displayed in the reference selector dialog by SharePoint type. Leave blank to display all items.
ClearFieldOnInsert
DialogToOpen
Filter
Height IncludeSensitiveWFConstants Gets or sets whether to list workflow constants that have been marked as sensitive to be listed in the possible references. The workflow action must also allow the user of sensitive constants for them to be successfully resolved. Gets the value of the control. Gets or sets the display status of the LDAP picker button, defaults to False. Get or set the width of the rendered field controls.
PlainText ShowLdapPickerButton
Width
SYNTAX
ASP.Net (Usage) <%@ Register TagPrefix="NWC" TagName="ReferenceTextField" Src="~/_layouts/NintexWorkflow/ReferenceTextFieldWebControl.ascx" %> <NWC:ReferenceTextField runat="server" id="referenceTextField1"></ NWC:ReferenceTextField>
JavaScript (Usage) // Set value translateTextAndInsertIntoRefTextField(referenceTextFieldClientId, value); // Retrieve value var value = getStringFromRefTextField(referenceTextFieldClientId);
www.nintex.com
connect.nintex.com
REMARKS
Workflow variables will only be listed in a workflow configuration dialog. They are obtained from the dialogArgs object that is passed into the configuration dialog by the workflow designer. Item properties will only be displayed if a QueryString value called ListId is present. ListId must contain the ID of the list to display properties from.
PROPERTIES
Name ApproverContext Description Gets or sets whether to include approver specific context items. This member is reserved for internal use; This value should be left as False.
HideInsertReferenceButtonInPlainTextMode HideModeChooser Gets or sets a Boolean that specifies whether to hide or show the mode selector. Default is False.
Height IncludeSensitiveWFConstants Gets or sets whether to list workflow constants that have been marked as sensitive to be listed in the possible references. The workflow action must also allow the user of sensitive constants for them to be successfully resolved. Gets or sets the text display before the mode selector Gets of sets a boolean value whether the control loads up in plain text mode. Default is False.
ModeSelectorText StartInPlainText
www.nintex.com
connect.nintex.com
SYNTAX
ASP.Net (Usage) <%@ Register TagPrefix="NWC" TagName="RichText" Src="~/_layouts/NintexWorkflow/RichTextWebControl.ascx" %> <NWC:RichText runat="server" id="richTexWeb" ApproverContext="true" ModeSelectorText="Format"></NWC:RichText>
JavaScript (Usage) // Get value var value = rte_getText(richTextEditorClientId); // Set value rte_SetText(richTextEditorClientId, Value); // Set the size rte_setSize(richTextEditorClientId, width, height); // Toggle between plain text MODE_PLAINTEXT and rich text rte_setTextEditorMode(richTextEditorClientId, mode); // Get the mode var value = rte_getTextEditorMode(richTextEditorClientId);
MODE_RTE
PREVIEW
REMARKS
A script on the page must be set to run after all other processing to apply a size to the rich text editor.
www.nintex.com
connect.nintex.com
SCRIPT LINK
This control is used to add the JavaScript files associated with Nintex Workflow to a page. Add it to the <head> element of a web page. Nintex.Workflow.ServerControls.ScriptLink
SYNTAX
ASP.Net (Usage) <%@ Register Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" Namespace="Nintex.Workflow.ServerControls" TagPrefix="NWC" %> <NWC:ScriptLink id="scriptLink1" runat="server"></NWC:ScriptLink>
PROPERTIES
Name AllowEmpty Description (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor) Gets or sets a Boolean that specifies if the panel for external email addresses is displayed. (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)
AllowExternalEmailAddresses
AllowTypeIn
www.nintex.com
connect.nintex.com
MultiSelect
PlaceButtonsUnderEntityEditor
Rows
SelectionSet
ValidatorEnabled
Width
SYNTAX
ASP.Net (Usage) <%@ Register TagPrefix="NWC" TagName="UserChooser" Src="~/_layouts/NintexWorkflow/UserChooserWebControl.ascx" %> <NWC:UserChooser id="userChooser" ShowCreateButtonInActiveDirectoryAccountCreationMode="false" runat="server"></NWC:UserChooser>
JavaScript (Usage) // Set the value. The value can be a semi colon delimitated string setPeopleEditorDisplayText(peopleEditorClientID, value); // returns a semi colon delimitated string of users var value = getUsersFromPeopleEditor(peopleEditorClientID); // Get the a reference to the people editor control getPeopleEditor(peopleEditorClientID); // Returns a collection of data for every entry in the box
www.nintex.com
connect.nintex.com
PREVIEW
REMARKS
Workflow variables will only be listed in a workflow configuration dialog. They are obtained from the dialogArgs object that is passed into the configuration dialog by the workflow designer.
www.nintex.com
connect.nintex.com
When using this control on a configuration dialog, setting the value must be done in an event attached to page load. JavaScript (Setting the value in a dialog) var setValue = function() { setPeopleEditorDisplayText("<%= userChooser.ClientID %>", value); } window.attachEvent("onload", setValue);
WORKFLOW VISUALISER
This control renders a workflow. Nintex.Workflow.ServerControls.WorkflowVisualiser
PROPERTIES
Name ButtonToDisable Description Gets or sets the client id of a button to disable if there are warnings regarding starting the workflow. ShowWarnings must be set to True. Gets or sets the instance id of a workflow instance to render. Required when RenderStyle is Runtime. Gets or sets the ID of the list that the workflow to display is associated with. Required when RenderStyle is Statistics or Preview.
InstanceId
ListId
www.nintex.com
connect.nintex.com
ShowMouseOverPopups
ShowPublishedVersion
ShowWarnings
Statistics
WorkflowId
WorkflowName
SYNTAX
ASP.Net (Usage) <%@ Register Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" Namespace="Nintex.Workflow.ServerControls" TagPrefix="NWC" %> <NWC:WorkflowVisualiser ID="WorkflowView" runat="server" Height="100%" Width="100%" />
REMARKS
If there is a failure rendering the workflow, a predefined message will be displayed:
More details are logged to the server application event log. For the correct styles to be applied to the rendered workflow, use the Nintex.Workflow.ServerControls.CssLink control and the Microsoft.SharePoint.WebControls.CssLink control on the page.
www.nintex.com
connect.nintex.com
PROPERTIES
Name Context Description Gets the Microsoft.SharePoint.WorkflowActions.WorkflowContext that the context is built for. Gets the Instance ID of the workflow that the context is built for. Gets the Item ID of the item that the context is built for. Gets the ID of the list that the context is built for. Gets the SPWeb that the context is built for. Gets the SPUser who started the workflow. Gets the SPWorkflow that the context is for.
METHODS
Name AddContextDataToString Description Takes a string containing tokens representing item properties, workflow variables, constants and common data and replaces the tokens with the current value. Overloads specify options on how to treat the context properties.
GetContextData GetContextKeys GetItemAsAttachment Gets a collection of all the available context tokens. Gets a collection of System.Net.Mail.Attachments based on the context SharePoint item. In a document library the collection contains a single attachment representing the item file. In a list, the collection contains an entry for each file in the SPListItem attachment collection. Gets a string containing the display url of the context SPListItem.
GetItemUrl
EXAMPLES
The following example demonstrates creating a NWContext object and using it to resolve a string containing context tokens.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
PROPERTIES
Name Data Description The resolved value of the context data
www.nintex.com
connect.nintex.com
PROPERTIES
Name Category Description Gets or sets a specifying the category of the context data. Recognised options are Common, WorkflowVariable, ItemProperty, and WorkflowConstant. Gets or sets a Microsoft.SharePoint.SPFieldType values representing the type of this context data. Gets or sets the friendly name of the context token. Gets or sets the internal name of the context token.
DataType
DisplayName Name
METHODS
Name CompareTo Description
REMARKS
When NWContext is used to replace tokens, it searches for tokens in the following format: {Category:Name}
www.nintex.com
connect.nintex.com
METHODS
Name DoesKeyExist Description Returns a Boolean if the collection contains a specific NWContextKey based on its Name and Category property.
www.nintex.com
connect.nintex.com
METHODS
Name InterpretEmailResponse Description Returns Nintex.Workflow.HumanApproval.Outcome of either Approved or Rejected based on if a LazyApproval term is found. Returns Pending if a term is not found.
www.nintex.com
connect.nintex.com
PROPERTIES
Name ApprovalBehaviour Description Gets or sets the Nintex.Workflow.HumanApproval.ApprovalType for this task. Gets or sets a string supporting the ApprovalBehaviour. Will contain a number representing the required approval responses for a Vote ApprovalBehaviour.
ApprovalBehaviourData
METHODS
Name ApprovalTask Description Constructor. Use NintexTask.RetrieveTask to obtain an instance of ApprovalTask. Cancels a task that is currently running. Registers a response to the task.
CancelApprovalTask ProcessResponse
REMARKS
An instance of an approval task can be retrieved us
www.nintex.com
connect.nintex.com
MEMBERS
Member name AllMustApprove FirstToRespond AnyApprove Vote Description Every response must approve. The first responder determines the outcome. If any approve is registered, the task is approved. A specified number of positive responses are required. ApprovalTask.ApprovalBehaviourData contains the required number.
www.nintex.com
connect.nintex.com
PROPERTIES
Name AllowDelegation Description Gets or sets a value that determines if this approver is allowed to delegate the task. Gets or sets the Message that will be sent if the approver no longer needs to respond to a task. Gets or sets the Nintex.Workflow.HumanApproval.Outcome that has been registered by the user. If no response has been registered, the value will be Pending. The ID of this approver. Corresponds to an ID stored in the database. Gets or sets the comments the approver registered with this task. Gets the time that the task was assigned to the approver. Gets the time that the approver completed the task. The Nintex.Workflow.HumanApproval.NintexTask that this approver has been assigned to. Gets or sets the Message that will be sent if to the approver when the task is assigned. Gets the ID of the SPListItem task that this approver must complete.
ApprovalNoLongerRquiredMessage
ApprovalOutcome
ApproverID
RequestApprovalMessage
SPTaskId
METHODS
Name Approver FlagTaskAsHidden Description Creates an Approver and assigns them to the parentTask. Hides the specified task for the user from the My Workflow Tasks webpart. Commits property changes to the database. Optionally updates the SPListItem task with the Comments and ApprovalOutcome.
Update
REMARKS
The term Approver also refers to users assigned to Review tasks.
www.nintex.com
connect.nintex.com
USERCONFIG
An object for storing limited details about a user. Used for assigning data to an Activity object. Inheritance Hierarchy: System.Object
PROPERTIES
Name DisplayName OtherEmailAddress PrincipalType User Description
www.nintex.com
connect.nintex.com
PROPERTIES
Name AllowDelegation AllowLazyApprove ApprovalNotRequiredMessage ApprovalRequiredMessage IsCustom Description
METHODS
Name Copy ToNWApprover Description
www.nintex.com
connect.nintex.com
PROPERTIES
Name DelegateUsername Description Gets or sets the login name of the user who will have tasks delegated to them. Gets the ID of the delegation record. Corresponds to an ID stored in the database. Gets or sets the date and time when the delegation rule will no longer apply. Gets or sets a formatted string representation of EndDate. Gets a string representing the scope of the delegation rule. Gets or sets the ID of the site collection containing the teamsite that the delegation rule applies to. Set to Guid.Empty for a global rule. Gets or sets the date and time from which the delegation rule will apply. Gets a formatted string representation of StartDate. Gets or sets the login name of the user who set up the delegation rule. Gets or sets the ID of the teamsite this delegation rule applies to. Set to Guid.Empty for a global rule.
DelegationID
EndDate
StartDate
StartDateDisplay Username
WebID
METHODS
Name DelegateApprovalTask Delegation Description Delegates an Approver to another user. Constructor. Creates a new delegation rule. Update must be called to persist the new rule. Deletes the delegation rule. Searches delegation rules for a login name and returns a delegate login name if a rule has been set up for the current time. Returns null if no delegate is found. Persists the property values to the database.
Delete FindDelegate
Update
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
PROPERTIES
Name ApproverID Comment Description Gets the ApproverID that the delegation applied to. Gets a string of comments that were entered to explain the delegation. Gets the login name of the user whom the task was delegated to. Gets the login name of the user who delegated the task.
DelegateUsername Username
www.nintex.com
connect.nintex.com
MEMBERS
Member name None Email SMS IM UserPreference Description
www.nintex.com
connect.nintex.com
PROPERTIES
Name AllowLazyApprove Description Gets or sets a value indicating whether the message is LazyApproval enabled. Gets or sets a value indicating if the workflow item should be attached to the message. Gets or sets the text of the notification body. Gets or sets a collection of users to include as CC recipients. Gets or sets a value indicating the mode of delivery. Gets or sets the user from whom the message should be sent from. Gets or sets a value indicating if the message is in HTML format. Gets or sets the subject of the notification.
AttachFile
IsHtmlMessage Subject
METHODS
Name Copy DecodeForLazyApproval DeSerialize Send Serialize Sends a message. Interprets a subject for a LazyApproval token. Description
www.nintex.com
connect.nintex.com
PROPERTIES
Name ApprovalStatus Approvers EntryTime ExitTime SequenceId Description Gets the Nintex.Workflow.HumanApproval.Outcome of the task. Gets the collection of users for the task. Gets the time and date that the task was created. Gets the time and date that the task was completed. Get a value that correlates the task to its position in the workflow. Gets the context of the workflow and task.
WFContext
METHODS
Name GetPendingApprover Description Returns an Approver object from a User and a SharePoint task item ID. Retrieves an SPListItem from a task list. Returns the NintexTask that is associated with a SPListItem task.
RetrieveSPListItem RetrieveTask
www.nintex.com
connect.nintex.com
PROPERTIES
Name AssignedTo Comments EntryTime HumanWorkflowID SharePointTaskId TaskName TaskType WorkflowInstaceId WorkflowName Description
www.nintex.com
connect.nintex.com
MEMBERS
Member name Approved Rejected Pending The task has not been responded to / the user has not yet registered a response. Description
Cancelled NotRequired Continue Delegated The approver is no longer required to respond to the task. Used to complete Review tasks.
www.nintex.com
connect.nintex.com
PROPERTIES
Name ApprovalBehaviour Description Gets or sets the Nintex.Workflow.HumanApproval.ApprovalType for this task. The only valid values are AllMustApprove and AnyApprove.
METHODS
Name CancelApprovalTask ProcessResponse ReviewTask Description Cancels the review task. Registers a response to the task. Constructor. Use NintexTask.RetrieveTask to obtain an instance of ApprovalTask.
www.nintex.com
connect.nintex.com
MEMBERS
Member name Approval Review Description Specifies an approval task. Specifies a review task.
www.nintex.com
connect.nintex.com
PROPERTIES
Name DisplayName IsDomainGroup IsSPGroup OtherEmailAddress SipAddress UserID Description Gets or sets the display name of the user. Gets or sets a value specifying if this user is a domain group. Gets or sets a value specifying if this user is a SharePoint group. Gets or sets the email address of the user. Gets or sets the SIP address of the user. Gets or sets the login name of the user.
METHODS
Name CheckAUserMatchesHWUser CheckCurrentUserMatchesHWUser CompareTo Copy Description Checks if a login name matches a user object. Checks if a user object matches the logged in user.
www.nintex.com
connect.nintex.com
PROPERTIES
Name User UserAssignString Description Gets the SPUser object of the user. Gets a value of the SharePoint representation of a user in id;#loginname format.
METHODS
Name UserInfo GetDisplayNameAndEmail WhatTypeOfPrincipalAmI Description Constructor. Ensures a user is a member of a teamsite. Searches for the display name and email address of a loginname, Searches SharePoint for a string to determine what type of principal it is. Useful when a user field in an action has been set as a workflow variable.
www.nintex.com
connect.nintex.com
PROPERTIES
Name AfterHours Description Gets or sets a value indicating a users preference for notifications out of business hours notifications. Gets or sets a value indicating a users preference for notifications during business hours notifications. Gets or sets the value to send SMS messages to.
BusinessHours
SMSAddress
METHODS
Name UserPreference Description Constructor. Creates an instance of UserPreference for a given login name. Persists the property values to the database.
Update
www.nintex.com
connect.nintex.com
OVERVIEW
Nintex Workflow web services have been developed to behave similar to SharePoint web services. To call the Nintex Workflow web service http://MyServer/[sites/][MySite/][MySubsite/]_vti_bin/NintexWorkflow/Workflow.a smx
For more information on SharePoint web service usage and coding see the Web Service Guidelines in the SharePoint SDK.
GetOutcomesForFlexiTask
www.nintex.com
connect.nintex.com
GetRunningWorkflowTasksCollection GetRunningWorkflowTasksForCurrentUser
GetRunningWorkflowTasksForCurrentUserForListItem
ProcessFlexiTaskResponse ProcessTaskResponse
ProcessTaskResponse2
PublishFromNWF
PublishFromNWFNoOverwrite
PublishFromNWFSkipValidation
PublishFromNWFSkipValidationNoOverwrite
PublishFromNWFXml
PublishFromNWFXmlNoOverwrite
PublishFromNWFSkipValidation
www.nintex.com
connect.nintex.com
PublishWorkflow
SaveFromNWF
SaveFromNWFNoOverwrite
SaveFromNWFXml
SaveFromNWFXmlNoOverwrite
TerminateWorkflowByNameForListItem
WorkflowExists
www.nintex.com
connect.nintex.com
SYNTAX
C# public int AddLongTermDelegationRule( DateTime fromTheBeginningOf, DateTime untilTheEndOf, string delegateFrom, string delegateTo, bool currentSiteOnly )
PARAMETERS
fromTheBeginningOf The date from when the delegation rule will take effect (from 12:01 in the morning). untilTheEndOf The date when the delegation rule will finish at the end of the day (midnight). delegateFrom The user whose tasks will be delegated. delegateTo The user to whom the tasks will be delegated to. currentSiteOnly True to restrict this rule to the context team site, false to make this rule global.
RETURN VALUE
The ID of the rule.
ADDWORKFLOWSCHEDULE
Adds or updates a workflow schedule on a file in a document library. Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx
SYNTAX
www.nintex.com
connect.nintex.com
PARAMETERS
fileUrl Url to the file with workflows containing running tasks. Can be absolute or server relative. workflowName The name of the workflow to schedule. startDataXml The xml representing the start data for a workflow. Can be an empty string. See Appendix B: Workflow Start Data Format for more information. schedule The details of when and until the schedule should run. All dates are in local time. updateIfExists If a schedule for the nominated workflow already exists on the nominated item, its details will be updated if this parameter is true.
RETURN VALUE
The ID of the newly created workflow schedule. -1 if an existing schedule was found and updateIfExists is false.
ADDWORKFLOWSCHEDULEONLISTITEM
Adds or updates a workflow schedules on a list item. Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx
SYNTAX
C# public int AddWorkflowScheduleOnListItem( int itemId, string listName, string workflowName, string startDataXml, Nintex.Workflow.Scheduling.Schedule schedule, bool updateIfExists
www.nintex.com
connect.nintex.com
PARAMETERS
itemId The list item ID to add a workflow schedule on. listName The name of the list containing the list item. workflowName The name of the workflow to schedule. startDataXml The xml representing the start data for a workflow. Can be an empty string. See Appendix B: Workflow Start Data Format for more information. schedule The details of when and until the schedule should run. All dates are in local time. updateIfExists If a schedule for the nominated workflow already exists on the nominated item, its details will be updated if this parameter is true.
RETURN VALUE
The ID of the newly created workflow schedule. -1 if an existing schedule was found and updateIfExists is false.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void DeleteSnippet( Guid snippetId )
PARAMETERS
snippetId A Guid that specifies the ID of the snippet.
www.nintex.com
connect.nintex.com
SYNTAX
C# public string[] DelegateAllTasks( string currentUser, string newUser, bool sendNotification, string comments, bool global )
PARAMETERS
currentUser The domain\login name of the user to whom tasks are currently assigned to. newUser The domain\login name of the user to whome the tasks will be delegated to. sendNotification True to send a notification message to the new assignee informing them that the task has been assigned to them. comments Any notes about why the task was delegated for the workflow history global True to delegate all tasks assigned to the currentUser in the farm. If False, only tasks in the site specified in the web service context url will be delegated. Delegating all tasks globally requires the user who invokes the web service be a farm administrator. When delegating for a specific site (The global parameter is False), the invoking user must be a site administrator.
RETURN VALUE
An array of error messages indicating any tasks that failed to be reassigned.
DELETELONGTERMDELEGATIONRULE
Deletes a delegation rule for a user. If the Allow site administrators to set long term delegation for other users option is switched off in Global Settings, the callee of the web service must be the user the delegation rule was created for. If the rule is scoped to a team site, the web service must be called in the scope of that team site. Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx
www.nintex.com
connect.nintex.com
PARAMETERS
id The domain\login name of the user to whom tasks are currently assigned to.
DELEGATETASK
Delegates a workflow task from one user to another. Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx Delegating a task with the web service follows the same rules as the UI. An error will be thrown if delegation is not enabled for the task unless the identity calling the web service is a site administrator.
SYNTAX
C# public bool DelegateTask( int spTaskId, string taskListName, string targetUsername, string comments, bool sendNotification )
PARAMETERS
spTaskId The SharePoint ID of the task to be reassigned. taskListName The name or GUID of the task list containing the task. targetUsername The domain\login name of the user to reassign the task to. comments Any notes about why the task was delegated for the workflow history sendNotification True to send a notification message to the new assignee informing them that the task has been assigned to them.
RETURN VALUE
False if the task is not pending, otherwise True.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
SYNTAX
C# public void DeleteWorkflow( Guid listId, Guid workflowId )
PARAMETERS
listId A Guid that specifies the ID of the list the workflow is associated with. workflowId A Guid that specifies the ID of the workflow
www.nintex.com
connect.nintex.com
SYNTAX
C# public string ExportWorkflow( string workflowName, string listName )
PARAMETERS
workflowName The name of the workflow to export. listName The name or ID of the list that contains the workflow.
RETURN VALUE
A string representing the contents of an Export file.
www.nintex.com
connect.nintex.com
SYNTAX
C# public string FixWorkflowsInSiteFromTemplate()
PARAMETERS
This web method has no parameters
www.nintex.com
connect.nintex.com
SYNTAX
C# public ItemsPendingApproval GetItemsPendingMyApproval( string uniquenessInfo )
PARAMETERS
uniquenessInfo Used to determine if data has changed.
RETURN VALUE
A collection of data representing a user's tasks.
www.nintex.com
connect.nintex.com
SYNTAX
C# public ConfiguredOutcomeCollection GetOutcomesForFlexiTask( int spTaskId, string taskListName )
PARAMETERS
spTaskId The list item id of the task. taskListName The name of the task list that contains the task.
RETURN VALUE
A collection of information about each configured outcome. Use the Name value of an outcome with the ProcessFlexiTaskResponse web service method.
www.nintex.com
connect.nintex.com
SYNTAX
C# public UserTaskCollection GetRunningWorkflowTasks( string fileUrl )
PARAMETERS
fileUrl Url to the file with workflows containing running tasks. Can be absolute or server relative.
RETURN VALUE
A collection of task information.
www.nintex.com
connect.nintex.com
SYNTAX
C# public UserTaskCollection GetRunningWorkflowTasksCollection( string userlogin, string teamsiteUrl, string listName )
PARAMETERS
userlogin Retrieve tasks for this user. Can be blank to retrieve tasks for all users. teamsiteUrl Retrieve tasks associated with this team site. If blank, the context team site will be used. listName Retrieves tasks associated with this list. Can be blank to retrieve tasks for all lists.
RETURN VALUE
A collection of task information.
www.nintex.com
connect.nintex.com
SYNTAX
C# public UserTaskCollection GetItemsPendingMyApproval( string fileUrl )
PARAMETERS
fileUrl Url to the file with workflows containing running tasks. Can be absolute or server relative.
RETURN VALUE
A collection of task information.
www.nintex.com
connect.nintex.com
SYNTAX
C# public UserTaskCollection GetRunningWorkflowTasksForCurrentUserForListItem( int itemId, string listName )
PARAMETERS
itemId The list item ID to retrieve running workflow tasks for. listName The name of the list containing the list item.
RETURN VALUE
A collection of task information.
www.nintex.com
connect.nintex.com
SYNTAX
C# public UserTaskCollection GetRunningWorkflowTasksForListItem( int itemId, string listName )
PARAMETERS
itemId The list item ID to retrieve running workflow tasks for. listName The name of the list containing the list item.
RETURN VALUE
A collection of task information.
www.nintex.com
connect.nintex.com
SYNTAX
C# public WorkflowLogCollection GetWorkflowHistory( string fileUrl, SPWorkflowState stateFilter, string workflowNameFilter )
PARAMETERS
fileUrl Url to a file in a document library to retreive workflow history for. Can be absolute or relative. stateFilter Filters results for workflows in a particular state. 'All' to not filter. workflowNameFilter Filter results for workflows matching this name. Can be blank to not filter.
RETURN VALUE
A collection of data containing action history, task history and workflow messages.
www.nintex.com
connect.nintex.com
SYNTAX
C# public WorkflowLogCollection GetWorkflowHistoryForListItem( int itemId, string listName, SPWorkflowState stateFilter, string workflowNameFilter )
PARAMETERS
itemId The list item ID of the item to retrieve workflow history for. listName The name of the list containing the list item. stateFilter Filters results for workflows in a particular state. 'All' to not filter. workflowNameFilter Filter results for workflows matching this name. Can be blank to not filter.
RETURN VALUE
A collection of data containing action history, task history and workflow messages.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void HideTaskForApprover( long approverId, int contentDbId )
PARAMETERS
approverId The Nintex internal ID of the approver. contentDbId The Nintex internal ID of the content database containing the task data.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool ProcessFlexiTaskResponse( string comments, string outcome, int spTaskId, string taskListName )
PARAMETERS
comments Any comments to record against the task response. outcome The response for the task. Use GetOutcomesForFlexiTask to discover the allowed responses. spTaskId The list item id of the task. taskListName The name of the task list that contains the task.
RETURN VALUE
True if task was processed successfully. False is the user context of the web service call is not a valid approver for the task. Other errors will manifest as an exception.
www.nintex.com
connect.nintex.com
SYNTAX
C# public ProcessTaskResponseResult ProcessFlexiTaskResponse( string comments, string outcome, int spTaskId, string taskListName )
PARAMETERS
comments Any comments to record against the task response. outcome The response for the task. Use GetOutcomesForFlexiTask to discover the allowed responses. spTaskId The list item id of the task. taskListName The name of the task list that contains the task.
RETURN VALUE
One of the following values: Success: The response was submitted correctly. CannotObtainLock: The task is locked by another operation so the response could not be submitted. For this result, it is good to inform the user to retry in a moment. InvalidUser: The user responding to the task is invalid.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool ProcessTaskResponse( string comments, Outcome outcome, int spTaskId )
PARAMETERS
comments Any comments to record against the task response. outcome The response for the task. Use 'Continue' for review tasks, 'Approved' or 'Rejected' for approval tasks. spTaskId The list item ID of the task.
RETURN VALUE
True if task was processed successfully. False is the user context of the web service call is not a valid approver for the task. Other errors will manifest as an exception.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool ProcessTaskResponse2( string comments, Outcome outcome, int spTaskId, string taskListName )
PARAMETERS
comments Any comments to record against the task response. outcome The response for the task. Use 'Continue' for review tasks, 'Approved' or 'Rejected' for approval tasks. spTaskId The list item id of the task. taskListName The name of the task list that contains the task.
RETURN VALUE
True if task was processed successfully. False is the user context of the web service call is not a valid approver for the task. Other errors will manifest as an exception.
www.nintex.com
connect.nintex.com
SYNTAX
C# public ProcessTaskResponseResult ProcessTaskResponse3( string comments, Outcome outcome, int spTaskId, string taskListName )
PARAMETERS
comments Any comments to record against the task response. outcome The response for the task. Use 'Continue' for review tasks, 'Approved' or 'Rejected' for approval tasks. spTaskId The list item id of the task. taskListName The name of the task list that contains the task.
RETURN VALUE
One of the following values: Success: The response was submitted correctly. CannotObtainLock: The task is locked by another operation so the response could not be submitted. For this result, it is good to inform the user to retry in a moment. InvalidUser: The user responding to the task is invalid.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWF ( byte[] workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFNoOverwrite ( byte[] workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFSkipValidation ( byte[] workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFSkipValidationNoOverwrite ( byte[] workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFXml( string workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFNoOverwrite ( string workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFXmlSkipValidation ( string workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool PublishFromNWFXmlSkipValidationNoOverwrite ( string workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used. saveIfCannotPublish Set to true to save the workflow if validation errors prevent the workflow from being publish.
RETURN VALUE
True if published, false is saved.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void PublishWorkflow( string wfName, NWActionConfigurations configs, Guid listId )
PARAMETERS
wfName A string specifying the workflow name. configs A XML Representation of the configurations for the actions contained in the object. listId A Guid specifying the ID of the list.
REMARKS
Parameter configs should be contained in the XML elements NWActionConfigurations/ActionConfigs. XML <NWActionConfigurations> <ActionConfigs> ... </ActionConfigs> </NWActionConfigurations>
www.nintex.com
connect.nintex.com
SYNTAX
C# public List<Nintex.Workflow.MessageBoxItem> QueryForMessages( Guid workflowInstanceId, string messageId )
PARAMETERS
workflowInstanceId
messageId
RETURN VALUE
An object presenting the data in the message.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool RemoveWorkflowSchedule( string fileUrl, string workflowName )
PARAMETERS
fileUrl Url to a file in a document library to retreive workflow history for. Can be absolute or relative. workflowName The workflow that the schedule was created for. An empty value will delete all schedules for the item.
RETURN VALUE
True if the schedule was found and removed. False if there was no schedule found for that workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool RemoveWorkflowScheduleOnListItem( int itemId, string listName, string workflowName )
PARAMETERS
itemId The list item ID of the item to retrieve workflow history for. listName The name of the list containing the list item. workflowName The workflow that the schedule was created for. An empty value will delete all schedules for the item.
RETURN VALUE
True if the schedule was found and removed. False if there was no schedule found for that workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public string RetrieveWorkflow( string workflowName, string webId, string listId )
PARAMETERS
workflowName A string specifying the workflow name. webId A string specifying the ID of the web containing the workflow. listId A Guid specifying the ID of the list.
RETURN VALUE
A string containing html representing the workflow.
www.nintex.com
connect.nintex.com
SAVEFROMNWF
Will save a workflow from the contents of an exported workflow. If validation errors prevent the workflow from publishing, it will be saved without publishing. Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx
SYNTAX
C# public Guid byte[] string string ) SaveFromNWF ( workflowFile, listName, workflowName
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used.
RETURN VALUE
Workflow ID of the newly saved workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid byte[] string string ) SaveFromNWFNoOverwrite ( workflowFile, listName, workflowName
PARAMETERS
workflowFile The byte contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used.
RETURN VALUE
Workflow ID of the newly saved workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid string string string ) SaveFromNWFXml( workflowFile, listName, workflowName
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used.
RETURN VALUE
Workflow ID of the newly saved workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid string string string ) SaveFromNWFXml( workflowFile, listName, workflowName
PARAMETERS
workflowFile The text xml string contents of a workflow export file. listName The name of the list to associate the workflow with. workflowName The name of the workflow. If blank, the name saved in the export file will be used.
RETURN VALUE
Workflow ID of the newly saved workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public string SaveSnippet( string snippetName, string activityConfigs )
PARAMETERS
snippetName A string specifying the snippet name. activityConfigs A XML Representation of the configurations for the actions contained in the object.
RETURN VALUE
Html of a snippet toolbox icon
REMARKS
Parameter activityConfig should be contained in the XML elements NWActionConfigurations/ActionConfigs. XML <NWActionConfigurations> <ActionConfigs> ... </ActionConfigs> </NWActionConfigurations>
www.nintex.com
connect.nintex.com
SYNTAX
C# public void string string string string ) SaveTemplate( templateName, templateDescription, category, activityConfigs
PARAMETERS
templateName A string specifying the template name. templateDescription A string specifying the template name. category A string specifying the category the template belongs to. activityConfigs A XML Representation of the configurations for the actions contained in the object.
REMARKS
Parameter activityConfig should be contained in the XML elements NWActionConfigurations/ActionConfigs. XML <NWActionConfigurations> <ActionConfigs> ... </ActionConfigs> </NWActionConfigurations>
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid SaveWorkflow( string wfName, string activityConfigs, Guid listId )
PARAMETERS
wfName A string specifying the workflow name. activityConfigs A XML Representation of the configurations for the actions contained in the object. listId The list ID to assign the workflow against.
RETURN VALUE
A Guid that specifies the ID of the workflow saved.
REMARKS
Parameter activityConfigs should be contained in the XML elements NWActionConfigurations/ActionConfigs. XML <NWActionConfigurations> <ActionConfigs> ... </ActionConfigs> </NWActionConfigurations>
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool SnippetExists( string snippetName )
PARAMETERS
snippetName A string specifying the snippet name.
RETURN VALUE
Returns a true if the snippet exists, otherwise false.
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid string string string ) StartWorkflow( fileUrl, workflowName, associationData
PARAMETERS
fileUrl Url to the file to start a workflow on. Can be absolute or server relative. workflowName The name of the workflow to run. associationData The xml representing start data. Can be blank for default. See Appendix B: Workflow Start Data Format for more information.
RETURN VALUE
The instance ID of the workflow instance.
www.nintex.com
connect.nintex.com
SYNTAX
C# public Guid string string string string ) StartWorkflowOnListItem( itemId, listName, workflowName, associationData
PARAMETERS
itemId The list item ID to retreive running workflow tasks for. listName The name of the list containing the list item. workflowName The name of the workflow to run. associationData The xml representing start data. Can be blank for default. See Appendix B: Workflow Start Data Format for more information.
RETURN VALUE
The instance ID of the workflow instance.
www.nintex.com
connect.nintex.com
SYNTAX
C# public bool TemplateExists string templateName )
PARAMETERS
templateName A string specifying the template name.
RETURN VALUE
Returns a true if the template exists, otherwise false.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void TerminateWorkflow( Guid listId, int itemId, Guid instanceId )
PARAMETERS
listId The ID of the list containing the list item. itemId The list item ID that the workflow is running on. instanceId The instance ID of the workflow to terminate.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void TerminateWorkflowByName( string fileUrl, string workflowName, bool terminatePreviousInstances )
PARAMETERS
fileUrl Url to the file to cancel a workflow on. Can be absolute or server relative. workflowName The name of the workflow to remove. terminatePreviousInstances If true, previous instances of the workflow that are running are also terminated.
REMARKS
User must have Web Designer permissions to cancel a running workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public void TerminateWorkflowByNameForListItem( string listName, int itemId, string workflowName, bool terminatePreviousInstances )
PARAMETERS
listName The list item ID that the workflow is running on. itemId The name of the list containing the list item. workflowName The name of the workflow to remove. terminatePreviousInstances If true, previous instances of the workflow that are running are also terminated.
REMARKS
User must have Web Designer permissions to cancel a running workflow.
www.nintex.com
connect.nintex.com
SYNTAX
C# public NameInUseStatus WorkflowExists( string workflowName, Guid listId )
PARAMETERS
workflowName A string specifying the workflow name. listId A Guid specifying the ID of the list.
RETURN VALUE
Returns a NameInUseStatus enum which represents the stats of the workflow, possible are: NameNotUsed, NameUsedInOtherList, NameUsedInThisList.
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
AllowCaching, CacheTimeOut, SqlQuery, QueryType, PageSize, AllowSorting, JoinType, PagingMode, DefaultSortExpression, Scope, ReportColumns, ReportParameters
PARENT ELEMENTS
None
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Text StoredProcedure TableDirect Description
An SQL text command.
The name of a stored procedure. All rows and columns of the named table or tables will be returned.
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Union Group Description Results from all content databases are retuned sequentially. Results with simular text fields are grouped together using the GroupOperator.
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Inbuilt Description Use the default paging in SPGridView when rendering results, the stored procedure must return the full result set. The stored procedure must support returning pages of results by specifying parameters.
Custom
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> <DefaultSortExpression>IdelTime</DefaultSortExpression> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Local Description The report will be executed only on the current webs Nintex Workflow content database. The report will be executed on all Nintex Workflow content databases.
Farm
EXAMPLE
Xml <ReportDefinition> <AllowCaching>true</AllowCaching> <CacheTimeOut>60</CacheTimeOut> <SqlQuery>rptWorkflowsInProgress</SqlQuery> <QueryType>StoredProcedure</QueryType> <PageSize>20</PageSize> <AllowSorting>true</AllowSorting> <JoinType>Union</JoinType> <PagingMode>Inbuilt</PagingMode> <Scope>Local</Scope> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
ReportColumn
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <ReportColumns> <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn> </ReportColumns> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
GroupOperator, UrlFormatString, FormatString, UrlColumnNames, SortExpression, Sortable, Name, DisplayName, DisplayType, IsTextColumn, IsValueColumn
PARENT ELEMENTS
ReportColumns
OCCURRENCES
Minimum: 0 Maximum: Unbounded
EXAMPLE
Xml <ReportColumns> <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn> </ReportColumns>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Key Sum Min Max Count First Description Defines that this column should not be grouped.
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <UrlFormatString>/_layouts/NintexWorkflow/Redirect.aspx?View =WorkflowStatus&InstanceID={0}&SiteID={1}&WebID={2} </UrlFormatString> <UrlColumnNames>WorkflowInstanceID,SiteID,WebID</UrlColumnNames> <SortExpression>WorkflowName</SortExpression> <Sortable>true</Sortable> <Name>WorkflowName</Name> <DisplayName>Workflow Name</DisplayName> <DisplayType>Hyperlink</DisplayType> <IsTextColumn>true</IsTextColumn> <IsValueColumn>false</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <UrlFormatString>/_layouts/NintexWorkflow/Redirect.aspx?View =WorkflowStatus&InstanceID={0}&SiteID={1}&WebID={2} </UrlFormatString> <UrlColumnNames>WorkflowInstanceID,SiteID,WebID</UrlColumnNames> <SortExpression>WorkflowName</SortExpression> <Sortable>true</Sortable> <Name>WorkflowName</Name> <DisplayName>Workflow Name</DisplayName> <DisplayType>Hyperlink</DisplayType> <IsTextColumn>true</IsTextColumn> <IsValueColumn>false</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Default Person TimeSpan Number Hidden Hyperlink SiteIDandWebID DateTime Description
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportColumn
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportColumn> <GroupOperator>Key</GroupOperator> <SortExpression>IdleTime</SortExpression> <Sortable>true</Sortable> <Name>IdleTime</Name> <DisplayName>Idle Time</DisplayName> <DisplayType>TimeSpan</DisplayType> <IsTextColumn>false</IsTextColumn> <IsValueColumn>true</IsValueColumn> </ReportColumn>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
ReportParameter
PARENT ELEMENTS
ReportDefinition
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportDefinition> <ReportParameters> <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter> </ReportParameters> </ReportDefinition>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
DisplayName, Name, Value, ParameterType, Required
PARENT ELEMENTS
ReportParameters
OCCURRENCES
Minimum: 0 Maximum: Unbounded
EXAMPLE
Xml <ReportParameters> <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter> </ReportParameters>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportParameter
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportParameter
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportParameter
OCCURRENCES
Minimum: 0 Maximum: 1
EXAMPLE
Xml <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> <Value>5</Value> </ReportParameter>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportParameter
OCCURRENCES
Minimum: 1 Maximum: 1
VALUES
Value Integer String Person Workflow Site Web This identifies this as a workflow Guid This identifies this as a site Guid This identifies this as a web Guid Description
EXAMPLE
Xml <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter>
www.nintex.com
connect.nintex.com
CHILD ELEMENTS
None
PARENT ELEMENTS
ReportParameter
OCCURRENCES
Minimum: 1 Maximum: 1
EXAMPLE
Xml <ReportParameter> <DisplayName>Initiator</DisplayName> <Name>@WorkflowInitiator</Name> <ParameterType>Person</ParameterType> <Required>false</Required> </ReportParameter>
www.nintex.com
connect.nintex.com
Description ActivityType ActivityAssembly AdapterType AdapterAssembly HandlerUrl Icon IconWarning IconToolbox RenderBehaviour ConfigPage QuickAccess
nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) tinyint nvarchar (255) bit 1 to display the action in the Commonly used category. Reserved for internal use only. The class of the workflow activity. The assembly containing the activity class. The class of the action adapter. The assembly containing the adapter class.
www.nintex.com
connect.nintex.com
RequiredFeatureSet
int
ActivityActivation This table defines which actions are available for use on different teamsites. Columns ActivityActivationID ActivityID SiteID WebID Type int - Identity int uniqueidentifier uniqueidentifier The ID of the action that the entry is for. Identifier of the site collection. Identifier of the teamsite. Description
ActivityResources Reserved for future use. Column ActivityID Category Description Icon IconWarning IconToolbox LCID Type int nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) smallint Description
www.nintex.com
connect.nintex.com
WebID
uniqueidentifier
Phrase Outcome
CustomContextData This table stores custom context data items that have been registered with Nintex Workflow. Column ID TypeName AssemblyName Type int - Identity nvarchar (255) nvarchar (255) Description
Databases This table stores the connection details for each content database. Column DatabaseID DatabaseName ServerName Username Password UseIntegrated Type int - Identity nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) bit The username to use if UseIntegrated is false. The password to use if UseIntegrated is false. Description
www.nintex.com
connect.nintex.com
StartDate
datetime
EndDate
datetime
SiteID
uniqueidentifier
WebID
uniqueidentifier
Delegate
nvarchar (255)
GlobalSettings This table stores configuration settings. Column SMTPServer Type nvarchar (255) Description The address of the smtp server used to send emails. The address from which notifications are sent. The reply to address for notifications.
nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) nvarchar (255) bit
1 to specify that a delay action must be inserted at the bottom of loops and state machines.
www.nintex.com
connect.nintex.com
AllowStaticDelegation
bit
AllowNotificationPreferences
bit
NeedDesignerRightsForSchedules
bit
TaskViewName
nvarchar (255)
LazyApprovalFooter
nvarchar (255)
Holidays This table stores the holidays that have been defined. Holidays are used when determining business hours. Column HolidayID HolidayName HolidayDate RepeatYearly WebId SiteId Type int - Identity nvarchar (255) datetime bit uniqueidentifier uniqueidentifier Description
LazyApprovalIgnoreTerms This table stores the terms that LazyApproval checks an incoming message subject for to determine if it should discard the message. Column Id Term Type int - Identity nvarchar (255) The text to search a subject for. Description
www.nintex.com
connect.nintex.com
www.nintex.com
connect.nintex.com
Header
nvarchar (1500)
Footer MessageNoLongerRequired
SiteID
uniqueidentifier
WebID
uniqueidentifier
Reports Lists the reports available to the reporting webparts. Reporting functionality is available for Enterprise licenses only. Column ID Title Description Role Type int - Identity nvarchar (256) nvarchar (256) nvarchar (256) The domain group that users must be a member of to view the report. The definition of the report. 1 to allow users to select the report in the report webparts. } The display name of the report. Description
DefinitionXML Enabled
text bit
ReportType
nvarchar (256)
www.nintex.com
connect.nintex.com
Storage This table maps site collections to Nintex Workflow content databases. All workflow instance data on the site collection will be stored in the content database listed here. Column DatabaseID SiteID Type int uniqueidentifier Description
UserPreference Stores preferences set by a user. Column Username Type nvarchar (255) Description The login name of the user that the settings apply to. The notification preference for messages that are sent out of business hours. The notification preference for messages that are sent during business hours. The address to send sms messages to for the user.
Afterhours
tinyint
Businesshours
tinyint
SMSAddress
nvarchar (255)
www.nintex.com
connect.nintex.com
WorkflowConstants This table stores the workflow constants that have been defined. Column ID Title Description Value Type int - Identity nvarchar (255) nvarchar (4000) nvarchar (4000) The value that is used to replace the constant at runtime. 1 if the value is encrypted. The name of the workflow constant. Description
WorkflowSchedule This table stores the workflow schedules. Column ScheduleId ItemId ListId Type int - Identity int uniqueidentifier The item ID that the schedule is defined on. The list ID of the list containing the item that the schedule is defined on. The ID of the teamsite that contains the item that the schedule is defined on. The ID of the sitecollection that contains the item that the schedule is defined on. The ID of the workflow that the schedule executes. Description
WebId
uniqueidentifier
SiteId
uniqueidentifier
WorkflowId
uniqueidentifier
www.nintex.com
connect.nintex.com
ModifiedBy
nvarchar (255)
www.nintex.com
connect.nintex.com
TABLES
This table stores information related to delegation history. DelegationHistory This table stores a record of task delegations. Column DelegationHistoryID Username Type int - Identity nvarchar (255) The login name of the user who delegated the task. The login name of the user who had the task delegated to them. The comments entered by the user to explain the delegation. The identifier of the task approver that the delegation applies to. Description
Delegate
nvarchar (255)
Comment
varchar (1024)
ApproverID
bigint
DatabaseID DelegationDate
HumanWorkflow This table stores information about tasks that have been assigned. Column HumanWorkflowID ApprovalType Type bigint - Identity tinyint The rules for task completion. Value corresponds to a member of Nintex.Workflow.HumanApproval.ApprovalType. The time and date that the task was assigned. The time and date that the task was completed. The outcome of the task. Value corresponds to a member of Nintex.Workflow.HumanApproval.Outcome Description
WorkflowTaskID
int
www.nintex.com
connect.nintex.com
ApprovalData
nvarchar (255)
TaskType
tinyint
HumanWorkflowApprovers This table stores information about each user that is assigned to a task. Column ApproverID HumanWorkflowID Username EmailAddress EntryTime ExitTime Type bigint - Identity bigint nvarchar (255) nvarchar (1024) datetime datetime The workflow task that the user is associated to. The login name or group name of the approver. The email address of the approver. The date and time when the task was assigned. The data and time when the approver responded. The comments entered by the user when registering their response. The response the user entered. Value corresponds to a member of Nintex.Workflow.HumanApproval.Outcome. The approval required message that was sent to this user. The approval not required message that was sent to this user. 1 if this approver is allowed to delegate the task. 1 if this approver is a domain group. 1 if this user is a SharePoint group. The ID of the SharePoint task item that represents the task. Description
Comments
nvarchar (1024)
Outcome
tinyint
ApprovalRequiredMessageTemplate
text
NoLongerRequiredMessageTemplate
text
AllowDelegation
bit
www.nintex.com
connect.nintex.com
Version Internal user only. This table stores the database version. Column Version Type nvarchar (50) Description
WorkflowInstance This table stores information about every workflow that is run. Column InstanceID XOML SiteID Type bigint - Identity text uniqueidentifier The version of the Xoml file this workflow uses. The ID of the site collection that the workflow was run on. The ID of the list containing the item that the workflow was run on. The ID of the list item that the workflow was run on. The ID of the teamsite that the workflow was run on. A timestamp of when the workflow was started. The ID used to identify the workflow instance in SharePoint. Obsolete. The login name of the user who started the workfklow. The display name of the workflow that was started. The ID of the workflow that was started. The current state of the workflow. Value corresponds to a member of Microsoft.SharePoint.Workflow.SPWorkflowState. Description
ListID
uniqueidentifier
ItemID
int
WebID
uniqueidentifier
StartTime WorkflowInstanceID
datetime uniqueidentifier
WorkflowData WorkflowInitiator
WorkflowName
nvarchar (255)
WorkflowID State
Uniqueidentifier int
www.nintex.com
connect.nintex.com
ExpectedDuration
int
WorkflowProgress This table stores a log of every action that is run in a workflow. Column WorkflowProgressID InstanceID Type bigint Identity bigint The ID of the workflow instance the action is associated with. The ID of the action type that this action is. See Activities table in the configuration database. Obsolete. 1 if the action has finished executing. The time the action was run. An identifier that associates an action with its position in the workflow. The name assigned to the action in the workflow designer. The number of minutes that the action is expected to take. Description
ActivityID
int
CurrentActivityTitle
nvarchar (255)
ExpectedDuration
int
www.nintex.com
connect.nintex.com
The SPListItem parameter is the SharePoint item that the workflow will run on. The SPWorkflowAssociation parameter represents the workflow to start. The SPList that contains the list item has a WorkflowAssociations collection property containing all the available SPWorkflowAssociation objects. The associationData parameter is a string of xml representing the workflow initiation data (referred to as Start Data in Nintex Workflow). To use the default initiation data, or if the workflow has no start data, pass in the AssociationData property of the SPWorkflowAssociation object. For more information on providing specific values for the associationData, see Appendix B.
www.nintex.com
connect.nintex.com
Each child element represents one start data item. The name of the element is the internal name of the start data item. To determine the internal name of the start data item: 1. 2. 3. 4. 5. Open SharePoint Designer to the site that holds the workflow Expand Workflows\NintexWorkflow\ Open the folder with the same name as your workflow Open the file with the same name as your workflow and an extension of .xoml.wfconfig.xml Find your start data item in the list of Parameter elements. The Name attribute is the internal name of the start data item.
This xml format is used both in workflows created with Nintex Workflow 2007 and SharePoint Designer. Note that date values must be in UTC, represented in the ISO8601 format. Note that in the Microsoft SharePoint Workflow API Start Data is referred to as Association Data. The default association data for a workflow can be queried via the AssociationData property of the SPWorkflowAssociation object representing the workflow.
www.nintex.com
connect.nintex.com