Nintex Workflow 2007 SDK 1.2

235
Nintex Workflow 2007 Software Development Kit

Transcript of Nintex Workflow 2007 SDK 1.2

Page 1: Nintex Workflow 2007 SDK 1.2

Nintex Workflow 2007 Software Development Kit

Page 2: Nintex Workflow 2007 SDK 1.2

Page 2 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

OVERVIEW

Welcome to the Nintex Workflow 2007 Software Development Kit (SDK). This document is intended for developers and

includes API documentation as well as technical "how to's" and code examples.

This SDK will be updated to include new API documentation and practical examples as they become available. Please submit

all feedback to [email protected].

To download the latest version of the Nintex Workflow 2007 software development kit and supporting resources please see

http://www.nintex.com/Nproducts/Workflow2007SDK.aspx.

WHAT’S 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

Page 3: Nintex Workflow 2007 SDK 1.2

Page 3 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SUPPORT RESOURCES

This section lists a range of software required to successfully develop for and extend Nintex Workflow.

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-83F5-

25634C3BF043&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-8023-

E8F38E709BA6&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-B39D-

37BAF6B5B1DC&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-a2ee-

4acc0aace5b6&displaylang=en

Page 4: Nintex Workflow 2007 SDK 1.2

Page 4 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO – INTERACTING AND EXTENDING NINTEX WORKFLOW

This section contains a number of examples demonstrating how to extend Nintex Workflow 2007 to meet custom business

requirements.

This section contains the following examples

1. InfoPath Forms Integration

2. Create a Custom Workflow Action – Overview

3. Create a Custom Workflow Action –Step by Step Guide

4. Create a Custom Task Response Form

5. Create a Custom Flexi Task Response Form

6. Export Workflow History

7. BizTalk Integration

8. Re-brand Nintex Workflow

9. Create custom context data items

10. Use the Error Handling Panel

11. Deploying a Nintex Workflow as part of a SharePoint solution package (WSP).

12. Deploying a custom workflow action as part of a SharePoint solution package (WSP).

13. Create an Inline Function

Page 5: Nintex Workflow 2007 SDK 1.2

Page 5 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: INFOPATH FORM INTEGRATION

SKILL LEVEL: INTERMEDIATE

OVERVIEW

This example will demonstrate the integration of Nintex Workflow into an InfoPath form. For the example we will be using

a basic expense form and business process; the form will collect some user details and details of an expense claim. The

form will then be submitted to a workflow for routing and approval.

The approval process will be integrated directly into the InfoPath form which will contain business logic to ensure the form

is not updated incorrectly. Please note that this example requires Microsoft Office 2007 InfoPath as some of the

functionality is not available in Microsoft Office 2003 InfoPath.

When integrating InfoPath and Nintex Workflow the two technologies do not directly interact with each other, they

communicate via SharePoint. This interaction is achieved via columns on the library; InfoPath writes key status information

to the columns and Nintex Workflow reads and writes back to the same columns allowing data to be shared.

The full example provided has hard coded data sources configured to communicate with the example SharePoint web

server http://development.nintex.com. When using this example file you will be required to change the data sources to

point to a valid URL in your environment.

Note: The provided examples have been developed with InfoPath Form Services enabled, which would allow the forms to

be used in InfoPath or a web client.

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. Form data

2. Form UI

3. Add data connections to Nintex Workflow

4. Add business logic (rules)

5. Publish the form

6. Create workflow

Page 6: Nintex Workflow 2007 SDK 1.2

Page 6 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SUPPLIED EXAMPLES

This example contains two InfoPath forms, the first is a completed version which has all the business logic integrated and

the second is a shell form only containing the UI elements.

Files

1. {SDK Location}\Examples\InfoPathExpenseIntegration\expenses_full.xsn

2. {SDK Location}\Examples\InfoPathExpenseIntegration\expenses_basic.xsn

STEPS AND PROCEDURES

This example will use expenses_full.xsn as a starting point; this file can be found in the directory for the example.

Step 1 – Form Data

1. Add the groups below in the Main data source, these groups will be used to logically store the data.

Group Name Parent Repeating

Items expenseReport No

Item Items Yes

Employee expenseReport No

ExpenseForm expenseReport No

ExpenseApproval expenseReport No

Tip: How to add a group

1. From the Task Pane, select Data Sources. 2. Right click on the top group, and select Add. 3. In the Name field enter the group name. 4. Select Group from the Type field. 5. Click Ok.

6. Add the following fields to the corresponding groups in the Main data source.

Field Name Group Type

Date Item Date

Description Item String

Amount Item Decimal

Total Items Decimal

ID Employee String

Name Employee String

Email Employee String

Department Employee String

Submitted ExpenseForm True/False

ExpenseState ExpenseForm String

FileUrl ExpenseForm String

WorkflowStatus ExpenseForm String

AllowEditing ExpenseForm True/False

AllowApproval ExpenseForm True/False

Comments ExpenseApproval Rich Text

Page 7: Nintex Workflow 2007 SDK 1.2

Page 7 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Image of data source with fields

Tip: How to add a field

1. From the Task Pane, select Data Sources. 2. Right click on the required group, and select Add. 3. In the Name field enter the field name. 4. Select the required field type from the Type field. 5. 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.

Page 8: Nintex Workflow 2007 SDK 1.2

Page 8 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

1. Bind the form sections to the appropriate data sources.

a. Bind the Employee Information section to expenseReport/Employee. When the Department field has

been added, change the control element from a text box to a drop-down list box and configure some

sample department names.

b. Bind the Approval section to expenseReport/ExpenseApproval

c. Bind the Submit section (the last section on the form [the large orange section]) to expenseReport

Tip: How to bind a field/control

1. An unbound field/control will have a red cross next to it ( ), when you hover over the red cross the following message will be displayed.

2. Right click on the unbound field/control and select Change Binding ( ). 3. Fromt the Selection Binding pop up window select the required field or group and click OK.

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 field’s 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.

Page 9: Nintex Workflow 2007 SDK 1.2

Page 9 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Figure: The completed design of the InfoPath form.

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.

2. 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.

Page 10: Nintex Workflow 2007 SDK 1.2

Page 10 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

3. Add a new data source to submit the form to a SharePoint library.

a. From the file menu click Tools -> Data Connections

b. Click Add

c. Select Create a new data connection to: and select Submit data, click Next

d. Select To a document library on a SharePoint site, and click Next

e. Enter the URL http://development.nintex.com/myformlibrary, click Next (please note that the form library

“myformlibrary” is a standard Form Library with no extra columns).

f. For the File name enter the function concat("Expenses - ", now(), " - ", userName()). click Next

g. Click Finish.

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 Load Workflow Information

Conditions FileUrl != “”

Actions 1. Set a fileUrl = FileUrl 2. Query using a data connection: GetRunningWorkflowTasksForCurrentUser

Field Fully Qualified References

fileUrl = GetRunningWorkflowTasksForCurrentUser /dfs:myFields/dfs:queryFields/ tns:GetRunningWorkflowTasksForCurrentUser/tns:fileUrl

fileUrl = /my:expenseReport/my:ExpenseForm/my:FileUrl

Figure: Screenshot from InfoPath’s logic inspector

Page 11: Nintex Workflow 2007 SDK 1.2

Page 11 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Setup approval control

Conditions Submitted = string(true()) AND SharePointTaskId != "" AND TaskType = "Approval"

Actions 1. Set a field's value: AllowApproval = true()

Field Fully Qualified References

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

Figure: Screenshot from InfoPath’s logic inspector

Name Setup editing control

Conditions Submitted = string(false()) OR Submitted = string(true()) AND SharePointTaskId != "" AND TaskType = "Approval"

Actions 2. Set a field's value: AllowEditing = true()

Field Fully Qualified References

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

Figure: Screenshot from InfoPath’s logic inspector

Page 12: Nintex Workflow 2007 SDK 1.2

Page 12 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

2. Configure the Approve button rules

a. Right click on the Approve button and click Properties

b. Click on the Rules… button

c. Add the rules outlined below. Use the Field Name References row as a field fully qualified field reference.

This will allow you to find the correct field in the Main data source.

Name Set Approval Settings

Conditions

Actions 1. Set a field's value: spTaskId = SharePointTaskId 2. Set a field's value: outcome = "Approved" 3. Set a field's value: comments = Comments 4. Query using a data connection: ProcessTaskResponse 5. Close the form

Field Fully Qualified References

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

Figure: Screenshot from InfoPath’s 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 Set Rejection Settings

Conditions

Actions 1. Set a field's value: spTaskId = SharePointTaskId 2. Set a field's value: outcome = "Rejected" 3. Set a field's value: comments = Comments 4. Query using a data connection: ProcessTaskResponse 5. Close the form

Field Fully Qualified References

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

Page 13: Nintex Workflow 2007 SDK 1.2

Page 13 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Figure: Screenshot from InfoPath’s 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 Submit Expense

Conditions

Actions 1. Set a field's value: Submitted = true() 2. Submit using a data connection: SharePoint Library Submit 3. Close the form

Field Fully Qualified References

Submitted = /my:expenseReport/my:ExpenseForm/my:Submitted

Figure: Screenshot from InfoPath’s 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

Page 14: Nintex Workflow 2007 SDK 1.2

Page 14 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Step 5 – Publish Form

1. The form is ready to be published to the server.

a. Click File -> Publish

b. Select To a SharePoint server with or without InfoPath Forms Services, click Next

c. Enter in http://development.nintex.com, click Next

d. Select Document Library as the publishing type, click Next

e. If you have not already created a library select Create a new document library, otherwise select Update

the form template in an existing document library. For this example we assume a blank form library is

already created called MyFormLibrary. Click Next

f. We now need to promote key fields in the form to columns in the library, these are used by Nintex

Workflow and InfoPath to share data. When adding each field ensure that the field can be editing from

within SharePoint by selecting the option Allow users to edit data in this field by using a datasheet or

properties page.

i. Submitted

ii. Total

iii. Expense State

iv. File Url

g. Click Next and the click Publish.

Page 15: Nintex Workflow 2007 SDK 1.2

Page 15 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Step 6 – Create Workflow

1. From the library where the form was created click Settings -> Create Workflow

2. Create a new blank workflow

3. Add a Wait for an item update action to the top of the workflow.

a. Configure the action to wait for the field Submitted to equal yes.

4. Add two Set field value actions to the workflow below the Wait for an item update action

a. Configure the first Set field value action to update the field File URL and configure it to look up the

current list item and reference the Server Relative URL field.

b. Configure the second Set field value action to update the Expense State field and configure it to a text

value of Pending.

5. Add a Request approval action. Configure the action to email yourself for testing purposes, however in a

production form this could be set to the current user’s manager.

6. On the Declined side of the Request approval action add a Set field value action and a Set approval status action.

a. Configure the Set field value action to update the field Expense State and configure it to a text value of

Rejected.

b. Configure the Set approval status action to set the status to Denied.

7. On the Approved side of the Request approval action add a Set field value action and a Set approval status action.

a. Configure the Set field value action to update the field Expense State and configure it to a text value of

Approved.

b. Configure the Set approval status action to set the status to Approved.

8. Next we need to configure the workflow to start when the expense form is first created.

a. Click Settings - > Startup options

b. Select Start when items are created, click Save.

9. Publish the workflow.

a. Click Actions -> Publish

b. Give the workflow a name and click Save.

The completed workflow design

Page 16: Nintex Workflow 2007 SDK 1.2

Page 16 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE A CUSTOM WORKFLOW ACTION – OVERVIEW

SKILL LEVEL: ADVANCED

OVERVIEW

This section provides background information about how Nintex Workflow (NW) adds actions to a workflow. All

actions in Nintex Workflow are Windows Workflows Foundation (WF) activities. To extend Nintex Workflow with

your own WF activities you must complete the following:

1. Create an Action Adapter that instructs NW how to handle the activity.

2. Develop a Configuration Dialog (aspx) page that provides a user interface for workflow designers to configure the

parameters for your action.

3. Author an .nwa (NW Action) file that describes your activity, the adapter class and the UI dialog to load. This file

will be imported into NW’s action list.

REQUIREMENTS

Windows SharePoint Services 3.0

Nintex Workflow 2007

Visual Studio

SUMMARY

1. Background Information

2. Steps to Create an Action

3. The Nintex Workflow 2007 Custom Action Visual Studio 2005 Project Template.

4. Troubleshooting

5. References

Page 17: Nintex Workflow 2007 SDK 1.2

Page 17 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STEPS AND PROCEDURES

Step 1 - Background Information

Figure: Designing a workflow

Figure: Publishing the Workflow

Page 18: Nintex Workflow 2007 SDK 1.2

Page 18 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

The list of available NW actions is stored in the NW configuration database. This database declares a relationship between a

WF Activity, an NW Adapter and a designer UI.

The adapter class must define methods to render the action in the UI and add an instance of the referenced WF activity to

the parent workflow.

The operations that are performed on an action for use in Nintex Workflow are as follows:

1. When the Workflow Designer is loaded, the database is queried and each allowed action is listed in the toolbox.

2. When an action is dragged on to the design canvas, the designer sends a request to the server detailing the action

that was selected. The server then invokes the necessary adapter class to obtain the html to render the action.

3. The rendered action has an attribute containing the default configuration xml along with the url of the aspx dialog

used to configure the action. The configuration xml is a serialized instance of the

Nintex.Workflow.Actions.Adapters.NWActionConfig class.

4. When the action is configured, the dialog page is opened as a modal window. The dialog is responsible for

modifying the configuration xml.

5. When the dialog returns, the configuration xml is sent to the server. The adapter then validates the configuration

and returns html. The returned html contains an attribute “IsValid” which is set by the adapter to indicate whether

or not the action configuration is valid. The workflow will not publish while an action has an invalid configuration.

6. When the workflow is published each action’s configuration xml is sent to the server as a batch. For each action

the corresponding adapter class’s AddActivityToWorkflow method is invoked. Typically this method will

instantiate an instance of the WF Activity it is responsible for, set the activity properties according to the

configuration xml and add the activity to the parent workflow object. Once all adapters have been called the

resulting workflow object is converted to WF Xoml and associated to a SharePoint list ready for use.

7. When a workflow is rendered, NW reads from the workflow’s Xoml. For each activity it determines the

corresponding adapter and calls a render method (either runtime, design or preview) to return html. The

NWActionConfig instance is obtained by passing the Activity into the adapter’s GetConfig method where the

properties of the Activity are read and an NWActionConfig object is constructed.

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

This interface contains members common for all adapters.

Page 19: Nintex Workflow 2007 SDK 1.2

Page 19 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Nintex.Workflow.Activities.Adapters.IActivityDesignTime

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

Page 20: Nintex Workflow 2007 SDK 1.2

Page 20 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

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.

Page 21: Nintex Workflow 2007 SDK 1.2

Page 21 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Additional context data in the dialog

The dialog is passed a querystring value called ListId which contains the Guid of the list that the workflow is being designed

for.

To get a list of workflow variables, call ListWorkflowVariables() in JavaScript. The result is an array of Xml Elements defining

each workflow variable, its type and whether it is initialized on the start workflow page.

See the Web Controls section of the SDK for information on controls that can be used to insert data references.

Importing into Nintex Workflow

The steps to import the custom action into Nintex Workflow are as follows:

1. Ensure all assemblies are strongly named and deployed to the Global Assembly Cache (GAC) on each front end web

server.

2. Open SharePoint Central Administration.

3. Choose Application Management.

4. Choose Manage Allowed Actions in the Nintex Workflow Management section.

5. Click the Add Action link.

6. Choose Import Workflow Action if you have a .nwa file from the Visual Studio project template and select the

correct file or expand Show Details and fill in the required fields manually. After importing a .nwa file, the details

can be verified by expanding Show Details.

7. Select the web application to register this activity on.

8. Click the Ok button. You will be redirected to the known action list.

9. Select the checkbox next to the new action to enable it.

10. 10. IISRESET

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.

Page 22: Nintex Workflow 2007 SDK 1.2

Page 22 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Step 3 - The Nintex Workflow 2007 Custom Action Visual Studio 2005 Project Template

Installed with this SDK is a project template for Visual Studio 2005 to assist with the development of custom actions.

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>

Page 23: Nintex Workflow 2007 SDK 1.2

Page 23 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Step 4 – Troubleshooting

Debugging the action

The adapter and activity code can be debugged in the SharePoint environment by installing a debug build and attaching a

debugger to each w3wp.exe process.

Nothing happens when the action is dragged onto the designer

This symptom will occur when the designer cannot find the class to load. Check that all the assembly and class information

for the activity and adapter is correct in the Manage Allowed Actions screen in Central Administration. This symptom will

also occur if an exception is thrown when rendering the action. Attach a debugger to the GetDefaultConfig and

ValidateConfig methods of the adapter to check if the code is throwing an exception. Also ensure that an IISRESET was

performed since the action was enabled.

The workflow status column shows Error Occurred

This symptom will occur when the WF Activity code throws an exception. Attach a debugger to the activity code.

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>

Page 24: Nintex Workflow 2007 SDK 1.2

Page 24 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Nintex Workflow Xml Node

The first few nodes hold system data and configuration dialogs can ignore the values.

The <TLabel>, <BLabel>, <LLabel> and <RLabel> elements hold the text is the top, bottom, left and right labels of the

action. The attributes LCustLbl, RCustLbl, TCustLbl and BCustLbl specify whether the user has customized any label with the

edit label dialog.

The <ExpectedDuration> holds the total minutes value if the user has specified an expected duration.

The <Assembly> and <Type> elements contain the reference to the adapter class for the action.

The <IsValid> value tells the designer whether the action is completely configured. It is set automatically by the system

based on result of the adapter’s ValidateConfig() method.

The <ConditionUse> element is a system node related to conditions.

The remaining nodes hold the configuration data. There are two sets of nodes: parameters and field references. Parameters

hold explicit values and field references can be used for a dynamic list of values. There is no hard rule regarding when and

how to use each.

Remember that the default configuration is defined in the GetDefaultConfig adapter method. The following code in

GetDefaultConfig would produce the corresponding Xml.

C#

NWActionConfig c = new NWActionConfig();

c.Parameters = new ActivityParameter[1];

c.Parameters[0] = new ActivityParameter();

c.Parameters[0].Name = "x";

c.Parameters[0].PrimitiveValue = new PrimitiveValue();

c.Parameters[0].PrimitiveValue.Value = "Some Value";

c.Parameters[0].PrimitiveValue.ValueType = SPFieldType.Text.ToString();

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.

Page 25: Nintex Workflow 2007 SDK 1.2

Page 25 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE A CUSTOM WORKFLOW ACTION –STEP BY STEP GUIDE

SKILL LEVEL: ADVANCED

OVERVIEW

This example details the steps required to create a custom action for Nintex Workflow 2007 (NW). This example will use

the example of a custom Windows Workflow Foundation (WF) activity that executes a SQL command against a database. It

will detail how to write the WF activity, the NW adapter, a user interface and how to expose the action in the NW designer.

The completed solution is included in this SDK.

This example will make use of the Nintex Workflow Action Visual Studio project template. For more information on Visual

Studio project templates see http://technet.microsoft.com/en-us/library/6db0hwky(VS.80).aspx.

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. Building the Workflow Foundation activity

2. Building the Nintex Workflow adapter

3. Building the configuration dialog

4. 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. {SDK Location}\Examples\ExecuteSqlAction

2. {SDK Location}\support\NW2007ActionProjectTemplate

Page 26: Nintex Workflow 2007 SDK 1.2

Page 26 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STEPS AND PROCEDURES

Step 1 - Building the Workflow Foundation activity

Every Nintex Workflow action is a WF Activity. In this example, the activity will accept a connection string, a SQL statement

to run against a database, and a reference to a workflow variable to return a result.

For more information about developing custom WF Activities, visit http://wf.netfx3.com/.

1. Create a new Visual Studio solution

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).

Page 27: Nintex Workflow 2007 SDK 1.2

Page 27 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

This activity will be written to be used in the context of SharePoint and Nintex Workflow. References must be

added to:

Microsoft.SharePoint.dll

Microsoft.SharePoint.WorkflowActions.dll

Nintex.Workflow.dll.

The SharePoint assemblies are located by default in c:\program files\common files\microsoft shared\web

server extensions\12\isapi. The Nintex Workflow assembly can be located from the GAC.

Add additional using statements as shown in the following code snippet.

Page 28: Nintex Workflow 2007 SDK 1.2

Page 28 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

using System.Data;

using System.Data.SqlClient;

using System.Workflow.ComponetModel;

using Microsoft.SharePoint.Workflow;

using Microsoft.SharePoint.WorkflowActions;

using Nintex.Workflow;

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:

Page 29: Nintex Workflow 2007 SDK 1.2

Page 29 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

public static DependencyProperty CurrentWorkflowVariableValuesProperty =

DependencyProperty.Register("CurrentWorkflowVariableValues",

typeof(Hashtable), typeof(ExecuteSqlActivity));

public static DependencyProperty __ListItemProperty =

DependencyProperty.Register("__ListItem", typeof(int),

typeof(ExecuteSqlActivity));

public static DependencyProperty __ContextProperty =

DependencyProperty.Register("__Context", typeof(WorkflowContext),

typeof(ExecuteSqlActivity));

public static DependencyProperty __ListIdProperty =

DependencyProperty.Register("__ListId", typeof(string),

typeof(ExecuteSqlActivity));

public static DependencyProperty ConnectionStringProperty =

DependencyProperty.Register("ConnectionString", typeof(string),

typeof(ExecuteSqlActivity));

public static DependencyProperty SqlQueryProperty =

DependencyProperty.Register("SqlQuery", typeof(string),

typeof(ExecuteSqlActivity));

public static DependencyProperty ResultOutputProperty =

DependencyProperty.Register("ResultOutput", typeof(string),

typeof(ExecuteSqlActivity));

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);

}

}

Repeat for each of the seven dependency properties.

Page 30: Nintex Workflow 2007 SDK 1.2

Page 30 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

5. Override the Execute method:

The Execute method of the activity defines the runtime behavior. To implement, override as follows:

C#

protected override ActivityExecutionStatus Execute(ActivityExecutionContext

executionContext){}

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.

Page 31: Nintex Workflow 2007 SDK 1.2

Page 31 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

{Common:xxxx}

predefined references. There is a list of common references is in the overview document.

{WorkflowConstant:constantName}

A workflow constant configured for the enviroment.

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,

Page 32: Nintex Workflow 2007 SDK 1.2

Page 32 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

TimeSpan.MinValue,

"Error",

string.Format("Error performing database action. {0}",

exception.Message),

string.Empty);

return base.HandleFault(executionContext, exception);

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.

The project template creates a number of files.

Page 33: Nintex Workflow 2007 SDK 1.2

Page 33 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Page 34: Nintex Workflow 2007 SDK 1.2

Page 34 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

You will need to add references to Microsoft.SharePoint.dll, Microsoft.SharePoint.WorkflowActions.dll,

Nintex.Workflow.dll and a project reference to the activity created in the first section.

The adapter inherits from Nintex.Workflow.Activities.Adapter.GenericRenderAdapter. Method stubs are created

for the methods that must be overridden. The following explains how to implement each method.

2. Override GetDefaultConfig

C#

public override NWActionConfig GetDefaultConfig(Guid listId){}

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.

Page 35: Nintex Workflow 2007 SDK 1.2

Page 35 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

5. Override ValidateConfig

C#

public override bool ValidateConfig(ActivityContext context){}

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

Page 36: Nintex Workflow 2007 SDK 1.2

Page 36 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

9. Create a new instance of the activity class

C#

ExecuteSqlActivity a = new ExecuteSqlActivity();

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 isn’t 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));

Page 37: Nintex Workflow 2007 SDK 1.2

Page 37 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

The activity also uses a hashtable of variable names and values for use in the NWContext object. The following

code hooks up this hashtable to the activity.

C#

ActivityBind currentVariablesHashtableBind =

ActivityAdapterUtil.AddAllVariablesNames(parentWorkflow);

a.SetBinding(ExecuteSqlActivity.CurrentWorkflowVariableValuesProperty,

currentVariablesHashtableBind);

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 activity’s

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.

Page 38: Nintex Workflow 2007 SDK 1.2

Page 38 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

15. Construct a new instance of NWActionConfig.

C#

NWActionConfig c = this.GetDefaultConfig(listId);

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));

19. Override BuildSummary

C#

public override ActionSummary BuildSummary(ActivityContext context)

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.

Page 39: Nintex Workflow 2007 SDK 1.2

Page 39 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

Dictionary<string, ActivityParameterHelper> parameters =

context.Configuration.GetParameterHelpers();

return new ActionSummary(string.Format("Run an SQL command on database

{0}.", parameters[ConnectionStringProperty].Value));

Step 3- Building the configuration dialog

The configuration dialog contains JavaScript to manipulate the configuration xml, which is an xml serialized form of the

NWActionConfig object generated in the adapter. The template aspx form in the project already includes references to the

Nintex Workflow dialog master page which references required script files.

1. Set the inherits property of the web form.

As this assembly will be deployed to the GAC, the page’s assembly reference must reference the strong name of

the assembly. In the markup view, add the full assembly reference to the Inherits declaration.

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:

Page 40: Nintex Workflow 2007 SDK 1.2

Page 40 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

JavaScript

var connectionStringCtrl;

var sqlQueryCtrl;

var resultOuputCtrl;

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.

Page 41: Nintex Workflow 2007 SDK 1.2

Page 41 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Page 42: Nintex Workflow 2007 SDK 1.2

Page 42 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

JavaScript

function TPAWriteConfig()

{

configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name

='ConnectionString']/PrimitiveValue/@Value").text =

connectionStringCtrl.value;

configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name

='SqlQuery']/PrimitiveValue/@Value").text = sqlQueryCtrl.value;

if(resultOuputCtrl.selectedIndex > -1){

configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter

[@Name='Output']/Variable/@Name").text =

resultOuputCtrl.options[resultOuputCtrl.selectedIndex].val

ue;}

return true;

}

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.

If the CustomActions folder doesn’t exist, create it.

Page 43: Nintex Workflow 2007 SDK 1.2

Page 43 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

3. Import the .nwa file

From SharePoint Central Administration, browse to Application Management -> Manage Allowed Actions (under

Nintex Workflow Management heading) and select Add Action.

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.

Page 44: Nintex Workflow 2007 SDK 1.2

Page 44 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE A CUSTOM TASK RESPONSE FORM

SKILL LEVEL: ADVANCED

OVERVIEW

This section describes how to create a custom task response form for the Request Approval or Request Review actions.

Tasks assigned via these workflow actions are created with a specific content type that is installed when Nintex Workflow is

activated. This content type has a custom edit form that is displayed when a user responds to a task. For more information

about content types, see MSDN article ‘Introduction to Content Types’ (http://msdn2.microsoft.com/en-

us/library/ms472236.aspx).

The approval and review actions can be configured to use a different content type. A custom approval form can be assigned

to this content type.

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. Create a custom Content Type

2. Create a custom form

3. Deploy the custom form

4. Update content type to use the custom form

5. 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.

Page 45: Nintex Workflow 2007 SDK 1.2

Page 45 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STEPS AND PROCEDURES

Procedure 1 – Create a custom Content Type

Content types can be created through the SharePoint user interface. When creating a custom content type, an existing

content type can be chosen as a base. In this case, the “Nintex Workflow Task” content type must be used.

To create a content type, follow these steps:

1. Open the “Site Settings” page of the team site that will contain the workflow.

2. Open the “Site content types” page under the Galleries section.

3. Select the "Create” button at the top of the existing content types list.

4. Enter a name and description of the content type.

5. Under “Parent Content Type”, select “Nintex Workflow” for the group and “Nintex Workflow Task” for the parent

content type.

6. Press Ok to complete creating the content type.

Page 46: Nintex Workflow 2007 SDK 1.2

Page 46 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Procedure 2 – Create a custom form

1. Basic task approval

To respond to a task and continue the workflow, the page code must open the task item and set certain values to

signify that the task has been completed.

The edit form for a task is provided with the following query string information:

Query string parameter Description

List The GUID of the task list.

ID The integer item ID of the task.

Source The URL that the user has come from. May not exist.

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:

Page 47: Nintex Workflow 2007 SDK 1.2

Page 47 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

Nintex.Workflow.Common.NWSharePointObjects.FieldComments

Nintex.Workflow.Common.NWSharePointObjects.FieldDecision

The valid values for the ‘decision’ are:

Outcome Value

Approved 0

Rejected 1

Continue (for review tasks) 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;

Page 48: Nintex Workflow 2007 SDK 1.2

Page 48 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Procedure 3 – Deploy the custom form

Custom aspx web forms are deployed to C:\Program Files\Common Files\Microsoft Shared\Web Server

Extensions\12\TEMPLATE\LAYOUTS. A subfolder should be created in the layouts directory for any custom web forms.

The compiled assembly should be deployed into the Global Assembly Cache. Repeat this on every front end server.

Alternatively, create a SharePoint solution to manage the deployment and retraction of the custom development. See

Solution Overview at MSDN for more information http://msdn2.microsoft.com/en-us/library/aa543214.aspx.

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”

Page 49: Nintex Workflow 2007 SDK 1.2

Page 49 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

nwadmin.exe –o SetTaskForm –siteUrl “http://companyportal.com/sites/finance” -

contentType “Finance Workflow Task” –taskformUrl

“_layouts/NintexTaskForms/CustomTaskForm.aspx” –formType All –updateChildren Yes

Procedure 5 – Configure the workflow

In the workflow designer, drag on a ‘Request Approval’ or ‘Request Review’ 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.

When the workflow is published, the content type will automatically be added to the task list used in the workflow.

Page 50: Nintex Workflow 2007 SDK 1.2

Page 50 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE A CUSTOM FLEXI TASK RESPONSE FORM

SKILL LEVEL: ADVANCED

OVERVIEW

This section describes how to create a custom task response form for the Assign a Flexi task action. This section will focus

on the differences between a custom task form for the Flexi task compared to custom task forms for Request Approval and

Request Review (covered in the previous section).

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.

Page 51: Nintex Workflow 2007 SDK 1.2

Page 51 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STEPS AND PROCEDURES

Custom Content Type

The Flexi Task action uses the “Nintex Workflow Multi Outcome Task” content type to generate tasks. To create a custom

form, a custom content type that has “Nintex Workflow Multi Outcome Task” as a parent must be created.

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.

Page 52: Nintex Workflow 2007 SDK 1.2

Page 52 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

The ConfiguredOutcome object has properties to describe the name, id and other meta data about the outcome.

The Nintex.Workflow.HumanApproval.Approver object has a property that lists each of the ConfiguredOutcomes available

for the task. The following code same demonstrates retrieving the Approver object and the available outcomes.

C#

NintexTask task = NintexTask.RetrieveTask(spTaskItemID,

SPContext.Current.Web, taskList);

// spTaskItemID is the integer Id of the task (provided in the form

query string)

// taskList is an SPList object representing the task list (provided

in the form query string)

Approver approver = task.Approvers.GetBySPId(spTaskItemID);

ConfiguredOutcomeCollection outcomes =

approver.AvailableOutcomeInfo.AvailableOutcomes;

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.

Page 53: Nintex Workflow 2007 SDK 1.2

Page 53 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

When the workflow is published, the content type will automatically be added to the task list used in the workflow.

Code example

Looking over and understanding the provided code example to see the completely implemented task form is strongly

recommended. The task form handles validation, security checking, and changing the UI depending on the type of task.

Page 54: Nintex Workflow 2007 SDK 1.2

Page 54 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: EXPORT WORKFLOW HISTORY

SKILL LEVEL: INTERMEDIATE

OVERVIEW

This example demonstrates the process of calling the Nintex Workflow web service to retrieve the workflow history for the

current item in the workflow and saves the output to a field on the current list item.

Although this example has been built using Nintex Workflow actions, the underlining principles can be applied to a custom

developed solution.

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. Preparation

2. 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. {SDK Location}\Examples\ExportWorkflowHistory\HistoryExportPlain.xsl

2. {SDK Location}\Examples\ExportWorkflowHistory\HistoryExportRich.xsl

STEPS AND PROCEDURES

Procedure 1 – Preparation

This example will collect the current workflow’s history and store the output in a column for the current item. You will need

to create a column of type text (either plain or rich text) in your sample list/library. The following steps adds a History

column to Shared Documents.

Page 55: Nintex Workflow 2007 SDK 1.2

Page 55 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Procedure 2 – Build Workflow

1. Create a new team site and enable Nintex Workflow. 2. Navigate to the Shared Documents library. 3. From the Settings link on the toobal click Create a Column. 4. Type History in the Column name field. 5. Select Multiple lines of text as the type of column. 6. Select Allow unlimited length in document libraries. 7. Click OK.

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.

Page 56: Nintex Workflow 2007 SDK 1.2

Page 56 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

e. Click Edit SOAP and populate the parameters, for an easy example you can use the following values to collect the current workflow history

i. fileUrl = {Common:ItemUrl} ii. stateFilter = Running

iii. workflowNameFilter = {Common:WorkflowTitle}

Nintex Workflow Web Service SOAP

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body>

<GetWorkflowHistory xmlns="http://nintex.com">

<fileUrl>{Common:ItemUrl}</fileUrl>

<stateFilter>Running</stateFilter>

<workflowNameFilter>{Common:WorkflowTitle}</workflow

NameFilter>

</GetWorkflowHistory>

</soap:Body>

</soap:Envelope>

f. Click XSL Transform and enter in you XSL code (see supporting files) g. Store the results in the workflow variable workflowHistory. h. Set the results format field to Xml. i. Save the configuration.

Figure: Call Web Service configuration settings.

Page 57: Nintex Workflow 2007 SDK 1.2

Page 57 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

18. Add an Update an item action below the web service action 19. Configure the update an item and set the Update field to Current item 20. On the field History click the “green arrow” button to field a lookup value. In the pop up window set the Source

field to Workflow Data, set the Workflow variable field to workflowHistory, click OK then click Save.

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. Navigate back to the Shared Documents library. 2. Create a new document and save it into the library. 3. From the new document's context menu select Workflows. 4. On the Workflows page click Nintex Workflow SDK Export Example, and then click Start.

Page 58: Nintex Workflow 2007 SDK 1.2

Page 58 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

5. Once the workflow is completed you will see that the History field has been updated.

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

Page 59: Nintex Workflow 2007 SDK 1.2

Page 59 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: NINTEX WORKFLOW INTEGRATION WITH MICROSOFT BIZTALK SERVER 2006

SKILL LEVEL: INTERMEDIATE/ADVANCED

OVERVIEW

Nintex Workflow Enterprise edition includes a Send / Receive BizTalk action for sending messages into BizTalk and / or

waiting to receive a message from BizTalk. The action communicates to BizTalk using out of the box BizTalk adapters. The

configuration of the workflow action generates the xsd schema files that match the message format that Nintex Workflow

expects so they can easily be imported as BizTalk ports.

In this scenario, a workflow is configured to send the username of the person who starts the workflow to BizTalk which

communicates with a HR system to return the number of hours of leave the person has remaining. The workflow can then

use this value elsewhere.

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. Preparing Nintex Workflow

2. Create the Orchestration

3. Publish the Orchestration web service

4. Configure the application in BizTalk Server Administration

5. Complete the workflow configuration

Page 60: Nintex Workflow 2007 SDK 1.2

Page 60 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STEPS AND PROCEDURES

Procedure 1 – Preparing Nintex Workflow

1. Create a workflow variable.

This workflow variable will hold the value that is returned from BizTalk.

2. Add a Send Receive BizTalk action.

The Send / Receive BizTalk action is available in the Integration panel.

Page 61: Nintex Workflow 2007 SDK 1.2

Page 61 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

3. Define the data to for this action.

Configure the Send / Receive BizTalk action.

The panels labeled Data to Send and Data to Receive define the workflow data items that will make up the

message to BizTalk and that will store the message that is received from BizTalk.

Any data can be sent to BizTalk.

Only workflow variables can store data that is received from BizTalk.

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.

Page 62: Nintex Workflow 2007 SDK 1.2

Page 62 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

At this point you can save the action and the workflow. We will finish configuring the action after we have

configured BizTalk.

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.

Page 63: Nintex Workflow 2007 SDK 1.2

Page 63 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

3. Add an Orchestration.

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.

Page 64: Nintex Workflow 2007 SDK 1.2

Page 64 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

5. Add a send port.

Follow the create port wizard to configure a send port.

6. Define messages

Use the schemas to create message instances, and bind the messages to the port operations.

Reminder that the schema files are named from the perspective of Nintex Workflow, that is SendMessage.xsd

represents a message being sent from Nintex workflow to BizTalk and ReceiveMessage.xsd represents the

response from BizTalk to Nintex Workflow.

Your orchestration should include all the elements shown in the following image. ‘‘Input’’ is a message created

from SendMessage.xsd and ‘‘Output’’ is a message created from ReceiveMessage.xsd. The operations on the ports

are bound to the appropriate message.

Page 65: Nintex Workflow 2007 SDK 1.2

Page 65 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

7. Define Orchestration.

Define the elements that make up the flow of your orchestration. Refer to the BizTalk Server 2006 documentation

for more information on designing orchestrations.

The requirement for Nintex Workflow is that the 'LocationId' and‘MessageId’ elements in the header of both the

send and receive message are bound to each other. Nintex Workflow uses these identifiers to determine which

workflow a message is intended for.

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.

Page 66: Nintex Workflow 2007 SDK 1.2

Page 66 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

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.

Page 67: Nintex Workflow 2007 SDK 1.2

Page 67 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

2. Follow the wizard

Choose the Publish Orchestration option.

Select the BizTalk application assembly

Select the public receive port

Page 68: Nintex Workflow 2007 SDK 1.2

Page 68 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Enter a namespace for the web service. This information will be used later when configuring the Nintex Workflow

action.

Enter the URL where the web service will be created. This information will be used later when configuring the

Nintex Workflow action.

You can specify your application for the publishing wizard to automatically generate the physical ports and

locations to correspond to this web service.

Page 69: Nintex Workflow 2007 SDK 1.2

Page 69 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Procedure 4 – Configure the application in BizTalk Server Administration

1. Finish configuring the web service receive location.

In the Receive Locations view, the generate location will be listed. If you already had the application open, you may

need to refresh it.

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.

Page 70: Nintex Workflow 2007 SDK 1.2

Page 70 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Choose the ‘‘Configure’’ button to set the properties of the port. The url should be http://<SharePoint

server>/_layouts/nintexworkflow/BiztalkHandler.ashx. Note that this url will handle workflows across the entire

farm. Site context in the url is not required. Enter proxy and authentication as required for your environment.

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 orchestration’s logical

ports.

4. Start the Orchestration.

Page 71: Nintex Workflow 2007 SDK 1.2

Page 71 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Procedure 5 – Complete the workflow configuration

1. Configure the Send / Receive BizTalk action

Open the saved workflow in Nintex Workflow 2007 and open the configuration screen for the Send/Receive BizTalk

action.

In the BizTalk Web Service Endpoint Settings panel enter the details of the web service that was published in

step 3.

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.

Page 72: Nintex Workflow 2007 SDK 1.2

Page 72 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: RE-BRAND NINTEX WORKFLOW

SKILL LEVEL: BEGINNER/ADVANCED

OVERVIEW

This guide will explain the different areas of Nintex Workflow where re-banding can be considered to integrate into a

custom design solution.

This example is supplied with a sample solution to demonstrate the coding section referenced Procedure 2. To run the

sample application load the solution and build the project, documentation is provided as inline XML comments.

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. Creation of CSS

2. Message template branding

3. Configure SharePoint to use new styling.

SUPPLIED EXAMPLES

This example contains a Visual Studio 2005 solution for a sample console application which set a web’s alternate CSS URL.

Solutions

1. {SDK Location}\Examples\AltCssApp

STEPS AND PROCEDURES

Procedure 1 – Creation of CSS

The first step in re-branding Nintex Workflow is to re-brand SharePoint. Nintex Workflow has been design to inherit most

of its style classes directly from SharePoint meaning that when a site is branded the Nintex Workflow designer should

automatically inherit the new branding. Note that the configuration dialogs are using separate styles and will not inherit

branding automatically.

There may be instances where a new style sheet does not “blend” completely with Nintex Workflow, to help identify what

CSS classes require changing you can use the Microsoft IE developer toolbar

(http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038) to analyze the

applied styles to any element on a web page.

Page 73: Nintex Workflow 2007 SDK 1.2

Page 73 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Once you have branded your SharePoint site you may find it necessary to override some of the custom Nintex Workflow

CSS classes. Overriding our classes is performed in the same as with SharePoint.

For more information on SharePoint branding see Cascading Style Sheets Class Definitions for Microsoft Windows

SharePoint Services in the SharePoint SDK

For more information on the features of the Microsoft IE developer toolbar and usage guides please see

http://www.microsoft.com/ie.

For more information on Cascading Style Sheets (CSS) please see http://www.w3.org/Style/CSS/.

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. Open your browser to your site collection root (top level site).

2. Create a new library called Styles

3. Upload you CSS file to this library.

4. Browse to the team site requiring branding

5. Browse to the site settings page.

6. Under the heading Look and Feel click Master Page

7. 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.

8. Click the Browse button and browse to the location where you uploading your CSS file in step 3.

9. Click OK to select the CSS file, and then click OK to save the changes.

Windows SharePoint Services - Alternate CSS

Page 74: Nintex Workflow 2007 SDK 1.2

Page 74 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

This method requires coding to the SharePoint object model to set the alterative CSS, as WSS 3.0 does not expose the

setting via the UI.

1. Open your browser to your site collection root (top level site).

2. Create a new library called Styles

3. Upload you CSS file to this library.

4. Load Visual Studio, and create a new C# Console Application.

5. Add a reference to the Microsoft.SharePoint.dll

6. Add a reference to the namespace Microsoft.SharePoint

7. In the Program.cs class file enter the following code in the body of the main static method

C#

SPSite site = new SPSite(“http://development.nintex.com”);

SPWeb web = site.OpenWeb();

web.AlternateCssUrl = “http://development.nintex.com/Styles/custom.css”;

web.Update();

web.Close();

site.Close();

Compile and run the console application, your team site alternative CSS will be updated.

Page 75: Nintex Workflow 2007 SDK 1.2

Page 75 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE CUSTOM CONTEXT DATA ITEMS

OVERVIEW

This section describes how to add additional items to the list of ‘Common’ data items that can be inserted into the text used

in various workflow actions.

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.

STEP 1: CREATE A CUSTOM DATA ITEM CLASS

Custom data items are created by inheriting from a Nintex Workflow defined interface.

1. Create a new Visual Studio project, and add references to Nintex.Workflow.dll and Microsoft.SharePoint.dll.

2. Inherit a class from Nintex.Workflow.ICommonDataItem

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

Page 76: Nintex Workflow 2007 SDK 1.2

Page 76 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Implement Method

public string GetValue(Nintex.Workflow.INWContext ctx)

{

return ctx.WorkflowInitiator.Email;

}

5. Sign and compile the assembly and then install it into the GAC.

STEP 2: REGISTER THE DATA ITEM

Once the assembly is created, it needs to be registed in Nintex Workflow. This is done with the NWAdmin tool.

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 AddCustomDataItem -Type <namespace.typename of data item class> -Assembly <fully qualified assembly name>

For the supplied example, the command might be:

nwadmin.exe -o AddCustomDataItem -Type “Nintex.Workflow.Addins.InitiatorEmailAddressDataItem” -Assembly “Nintex.Workflow.Addins.CustomDataItems, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx”

Preform an IISRESET to refresh the cached of installed data items.

You can now use your data item in a workflow.

Page 77: Nintex Workflow 2007 SDK 1.2

Page 77 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: USE THE ERROR HANDLING PANEL

OVERVIEW

This section describes how to use the error handling panel in a custom action. Code must be added to the activity, adapter

and configuration dialog.

REQUIREMENTS

Nintex Workflow build 10828 or greater.

Knowledge of creating a custom action for Nintex Workflow is assumed.

STEP 1: ADD CODE TO THE ACTIVITY CLASS

The following dependency properties are used on the activity to use the error handling settings. In this example, the activity

class is called MyActivity.

Register Dependency Properties

public static DependencyProperty CaptureErrorsProperty =

DependencyProperty.Register("CaptureErrors", typeof(bool), typeof(MyActivity));

public static DependencyProperty ErrorOccurredOutputProperty =

DependencyProperty.Register("ErrorOccurredOutput", typeof(bool),

typeof(MyActivity));

public static DependencyProperty ErrorMessageOutputProperty =

DependencyProperty.Register("ErrorMessageOutput", typeof(string),

typeof(MyActivity));

Implement Dependency Properties

[ValidationOption(ValidationOption.Optional), Browsable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]

public bool CaptureErrors

{

set

{

base.SetValue(CaptureErrorsProperty, value);

}

Page 78: Nintex Workflow 2007 SDK 1.2

Page 78 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Implement Dependency Properties

get

{

return (bool)base.GetValue(CaptureErrorsProperty);

}

}

[ValidationOption(ValidationOption.Optional), Browsable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]

public bool ErrorOccurredOutput

{

set

{

base.SetValue(ErrorOccurredOutputProperty, value);

}

get

{

return (bool)base.GetValue(ErrorOccurredOutputProperty);

}

}

[ValidationOption(ValidationOption.Optional), Browsable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]

public string ErrorMessageOutput

{

set

{

base.SetValue(ErrorMessageOutputProperty, value);

}

get

{

return (string)base.GetValue(ErrorMessageOutputProperty);

}

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;

}

Page 79: Nintex Workflow 2007 SDK 1.2

Page 79 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Handle error in execution

else

throw;

}

STEP 2: ADD CODE TO THE ADAPTER CLASS

The adapter must know how to save and retrieve the values for error handling just like any other parameter.

Assign the error handling node to the default configuration in the GetDefaultConfig method of the adapter.

GetDefaultConfig

NWActionConfig config = new NWActionConfig(this);

...

...

config.ErrorHandling = new ErrorHandling();

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.

STEP 3: ADD THE CONTROL TO THE ASPX DIALOG

The error handling panel is implemented as a user control. First, register the control on the page:

Page 80: Nintex Workflow 2007 SDK 1.2

Page 80 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Registering the ErrorHandlingConfig control

<%@ Register TagPrefix="Nintex" TagName="ErrorHandlingConfig"

Src="~/_layouts/NintexWorkflow/ErrorHandlingConfig.ascx" %>

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.

ADD JAVASCRIPT TO STORE AND SAVE VALUES

In the TPARetrieveConfig method add the following code:

TPARetrieveConfig

LoadErrorHandlingSection();

In the TPAWriteConfig method add the following code:

TPAWriteConfig

SaveErrorHandlingSection();

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.

Page 81: Nintex Workflow 2007 SDK 1.2

Page 81 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: DEPLOY A NINTEX WORKFLOW AS PART OF A SHAREPOINT SOLUTION PACKAGE (WSP)

SKILL LEVEL: ADVANCED

OVERVIEW

Many solution developers have asked how they can deploy a declarative Nintex Workflow as part of a custom SharePoint

solution package. This document and the supplied example Visual Studio solution demonstrate how this can be achieved.

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

Page 82: Nintex Workflow 2007 SDK 1.2

Page 82 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

This is a standard SharePoint feature definition. The things of interest here are the ReceiverAssembly and ReceiverClass.

This points to the SPFeatureReceiver class called when the feature is activated or de-activated. The nwf file containing the

Nintex Workflow definition is referred to in the <ElementManifests> section and an activation dependency has been

specified to prevent this from being activated on a site that does not have the Nintex Workflow features active.

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="C7161CF2-FB53-4823-A74F-94A58E94ACD1"

Title="My Nintex Workflow Feature"

Description="An example feature used to create a list and deploy a Nintex Workflow (.nwf) file"

ReceiverAssembly = "Nintex.MyWorkflowFeature, Version=1.0.0.0, Culture=neutral,

PublicKeyToken=7fc72706a49c89a6"

ReceiverClass = "Nintex.MyWorkflowFeature.DeployWorkflow"

Version="12.0.0.0"

Scope="Web"

xmlns="http://schemas.microsoft.com/sharepoint/"

ImageUrl="$Resources:NWResource,SiteCollectionFeature_ImageUrl;"

Hidden="FALSE"

AlwaysForceInstall="TRUE"

SolutionId="{8cc9ca9d-1caf-426e-87ae-af40161a46d8}">

<ElementManifests>

<ElementFile Location="workflow.nwf" />

</ElementManifests>

<ActivationDependencies>

<ActivationDependency FeatureId="9BF7BF98-5660-498a-9399-BC656A61ED5D"/>

</ActivationDependencies>

</Feature>

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

Page 83: Nintex Workflow 2007 SDK 1.2

Page 83 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Since we are calling a web service, we need to create network credentials to authenticate. The example code demonstrates

3 ways of doing this. One way is to setup a Nintex Workflow constant in central administration. You could also hard code a

username and password but this is not recommended for obvious reasons. If neither of these methods are available, the

code will fall back to using the System.Net.CredentialCache.DefaultNetworkCredentials. If you are using a Nintex

credential constant for retrieving the username and password, update the class constant with constant name used in your

environment.

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. This assembly must be strong named and installed to the GAC.

myKen.snk

Strong name key file.

MyWorkflowFeature.wsp

This file is created automatically by a post build event. This is the output WSP solution package.

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

Page 84: Nintex Workflow 2007 SDK 1.2

Page 84 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: DEPLOY A CUSTOM WORKFLOW ACTION AS PART OF A SHAREPOINT SOLUTION PACKAGE

(WSP)

SKILL LEVEL: ADVANCED

OVERVIEW

This section demonstrates how a custom workflow action could be deployed as a part of a SharePoint solution package.

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. Register the action with Nintex Workflow

2. Enable the action to be used in the workflow designer for the farm

3. 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.

Page 85: Nintex Workflow 2007 SDK 1.2

Page 85 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

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/"

Page 86: Nintex Workflow 2007 SDK 1.2

Page 86 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ImageUrl="$Resources:NWResource,SiteCollectionFeature_ImageUrl;"

Hidden="FALSE"

AlwaysForceInstall="TRUE"

SolutionId="{125e9779-c7be-4b9e-901e-7e9b447a93ca}">

<ElementManifests>

<ElementFile Location="EventLogAction.nwa" />

</ElementManifests>

</Feature>

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

Page 87: Nintex Workflow 2007 SDK 1.2

Page 87 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

One the solution is deployed, there will be a new feature listed in the Manage Web Application Features page.

Once the feature is activated you will be able to use the action in the workflow designer.

Page 88: Nintex Workflow 2007 SDK 1.2

Page 88 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HOW TO: CREATE AN INLINE FUNCTION

OVERVIEW

This section describes how to add additional inline functions for workflow designers to use to manipulate workflow data.

REQUIREMENTS

Nintex Workflow build 10903 or greater.

CREATE AN INLINE FUNCTION

The requirements for a function to be used by Nintex Workflow are:

It is a static method

It accepts parameters that can be parsed from text

It is contained in a type installed into the GAC on each web server

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.

REGISTER THE FUNCTION

The NWAdmin.exe tool is used to register the function with Nintex Workflow. See the NWAdmin.exe documentation for

command details. The following commands relate to inline functions:

AddInlineFunction registers an inline function with Nintex Workflow.

EnumInlineFunctions displays all the functions registered in Nintex Workflow, including the out of the box functions.

RemoveInlineFunction unregisters a function from Nintex Workflow.

Page 89: Nintex Workflow 2007 SDK 1.2

Page 89 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STYLE GUIDE

Nintex workflow has been developed to integrate with the look and feel of your existing SharePoint team site, using the out

of the box SharePoint styling classes. This has the advantage when branding a team site you are not required to develop

custom styles class for Nintex Workflow. There is however a couple of places where Nintex Workflow has created its own

styles to implement the required UI. The defined classes table below details the key classes used by Nintex Workflow.

To override Nintex Workflow out of the box classes use the AlternateUrl property of the SPWeb object from within the

SharePoint API’s, or from the team site setting page (under look and feel).

DEFINED CLASSES

Selector Description Preview

ms-menutoolbar

ActivityLabel

DropZone

ActivityIcon

SmallActivityIcon

ms-quickLaunch

expanded Defines the look of a workflow actions toolbar category in the expanded state.

-

collapsed Defines the look of a workflow actions toolbar category in the collapsed state.

-

ms-navheader

divToolBoxActivity

Page 90: Nintex Workflow 2007 SDK 1.2

Page 90 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Selector Description Preview

ToolboxItem

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.

RowWhite Defines an alternating row colour on the action configuration interface.

Label Defines a label used in the action configuration screen.

expandme

closeme

NWDesignTimeCanvas Applied to the area in which a workflow is designed.

NWPreviewCanvas Applied to the area in which a workflow is displayed on the start workflow page and when viewing a workflow from the workflow gallery.

NWRuntimeCanvas Applied to the area in which a workflow instance (e.g. a workflow in progress) is displayed.

Page 91: Nintex Workflow 2007 SDK 1.2

Page 91 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Selector Description Preview

NWStatisticsCanvas Applied to the area in which a workflow is displayed in statistics view (Enterprise edition only).

NWDesignTimeAction Applied to an action on the workflow designer. The style is applied to the table containing the whole action, the td containing the top label, and the tbody containing the icon.

NWPreviewAction Applied to an action rendered in a workflow in the preview view.

NWStatisticsAction Applied to an action rendered in a workflow in the statistics view.

NWRuntimeFutureAction Applied to an action rendered in a workflow instance view. This action has not yet run (colored grey).

NWRuntimePastAction Applied to an action rendered in a workflow instance view. This action has completed (colored green).

NWRuntimePresentAction Applied to an action rendered in a workflow instance view. The workflow is currently waiting on this action (colored yellow).

NWRuntimeActionOverrideRed Applied to a request approval action that has been declined (colored red).

NINTEX WORKFLOW CASCADING STYLE SHEETS ON THE FILE SYSTEM

Name Location

Dialogue C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\NINTEXWORKFLOW\dialogue.css

SLStyles C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\NINTEXWORKFLOW\SLStyles.css

These stylesheets can be added using the Nintex.Workflow.ServerControls.CssLink control.

Page 92: Nintex Workflow 2007 SDK 1.2

Page 92 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

MASTER PAGES

Nintex Workflow contains a single custom master page, used in the actions configuration dialog. All other pages in Nintex

Workflow use the default master page associated with the site.

The master page associated with the actions dialog window is located at C:\Program Files\Common Files\Microsoft

Shared\web server extensions\12\TEMPLATE\LAYOUTS\NINTEXWORKFLOW\ActivityUIMasterPage.master.

The following table describes the content placeholders contained in the ActivityUIMasterPage.

CONTENT PLACEHOLDERS DEFINED IN ACTIVITYUIMASTERPAGE.MASTER

Name of Content Placeholder Description

AdditionalPageHeader Additional content that needs to be within the <head> tag of the page, for example, references to script in style sheets

IconPlaceHolder The location for the icon of the action

TitlePlaceHolder The title of the action

NintexPropertyPlaceHolder The main body of the dialog

SaveButtonPlaceHolder Save button

CancelButtonPlaceHolder Cancel button

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

Page 93: Nintex Workflow 2007 SDK 1.2

Page 93 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

WEB CONTROLS REFERENCE

This section of the Nintex Workflow Software Development Kit (SDK) includes information about the controls available for

use in custom action dialogs and other custom pages that can interact with Nintex Workflow.

Please note that most server controls assume they are running in a SharePoint context, and expect SPContext.Current to be

populated.

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 Description

CssClass Gets or sets the style sheet for the control text controls embedded in the control.

DialogContainerClass Gets or sets the style sheet for the div element that the text controls are embedded in.

DisplayMode 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.

IsUsingPredefinedCredential Gets a Boolean value that specifies if control is using predefined credentials.

Password Gets a string containing the password.

PredefinedCredentialID Gets a integer that identifies the predefined credentials.

RequiredField Gets or sets whether to display a red asterisks to indicate the control is a required field.

Username Gets a string containing the username.

Width Get or set the width of the rendered field controls.

METHODS

Name Description

IsEmpty

SYNTAX

ASP.Net (Usage)

Page 94: Nintex Workflow 2007 SDK 1.2

Page 94 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ASP.Net (Usage)

<%@ Register TagPrefix="NWC" TagName="CredentialControl"

Src="~/_layouts/NintexWorkflow/CredentialControl.ascx" %>

<NWC:CredentialControl DisplayMode="dialog" CssClass="ms-input" Width="170px"

runat="server" id="credentialPicker"></NWC:CredentialControl>

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,

Page 95: Nintex Workflow 2007 SDK 1.2

Page 95 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C# (Determining runtime credentials)

this.Password, out runtimeUsername, out runtimePassword, webId, siteId);

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" />

JavaScript (Usage)

// Get value

var value = GetDurationValue();

// Set value

InitDurationSelector(parameters[5].childNodes[0].getAttribute(iTotalMinutes));

Page 96: Nintex Workflow 2007 SDK 1.2

Page 96 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PREVIEW

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 Description

InstanceID 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.

Item Gets or sets the list item to display properties for.

ItemLinkSource 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.

ItemLinkTarget Gets or sets the “target” attribute to add to the hyperlink that opens the item the workflow is running on. Default is “_blank”.

Page 97: Nintex Workflow 2007 SDK 1.2

Page 97 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Description

HideEmptyFields Gets or sets whether to display fields that are empty or skip them. Default is false.

MultipleLookupsSeparator Gets or sets the value to separate values in a multiple lookup field. Default is “<br />”.

ShowAttachments Gets or sets whether or not to list attachments from the item the workflow is running on.

ShowWorkflowItemLink Gets or sets whether or not to display a link to the item the workflow is running on.

ShowWorkflowStatusLink Gets or sets whether or not to display a link to the workflow status page.

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.

PLAIN TEXT WEB CONTROL

This control is used on action configuration dialogs to capture text from the client in plain text format. It allows use of

reference lookups which are replaced at runtime by the Nintex Workflow engine. Lookup categories include common, item

properties, workflow variables and workflow constants.

Nintex.Workflow.ApplicationPages.PlainTextWebControl

PROPERTIES

Name Description

ApproverContext Gets or sets whether to include approver specific context items. This member is reserved for internal use; This value should be left as False.

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.

CssClass1 Gets or sets the style sheet for the control.

Page 98: Nintex Workflow 2007 SDK 1.2

Page 98 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Description

TextAreaCols Gets of sets the columns for the control.

TextAreaRows Gets of sets the rows for the control.

Width Get or set the width of the rendered field controls.

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.

REFERENCE TEXT FIELD WEB CONTROL

This control provides a single line text input that includes a button to insert workflow context references. It is intended for

use on action configuration dialogs.

Page 99: Nintex Workflow 2007 SDK 1.2

Page 99 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Nintex.Workflow.ApplicationPages.ReferenceTextFieldWebControl

PROPERTIES

Name Description

ApproverContext Gets or sets whether to include approver specific context items. This member is reserved for internal use; This value should be left as False.

ClearFieldOnInsert 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.

DialogToOpen 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.

Filter Gets or sets a value to filter the values displayed in the reference selector dialog by SharePoint type. Leave blank to display all items.

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.

PlainText Gets the value of the control.

ShowLdapPickerButton Gets or sets the display status of the LDAP picker button, defaults to False.

Width Get or set the width of the rendered field controls.

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);

Page 100: Nintex Workflow 2007 SDK 1.2

Page 100 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PREVIEW

With ShowLdapPickerButton set to False:

With ShowLdapPickerButton set to True:

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.

RICH TEXT WEB CONTROL

This control is used on action configuration dialogs to capture text from the client in plain text or rich HTML format. It

allows use of reference lookups which are replaced at runtime by the Nintex Workflow engine. The control can be

configured to allow the client to select the text format or be forced to use a predefined format.

Nintex.Workflow.ApplicationPages.RichTextWebControl

PROPERTIES

Name Description

ApproverContext 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.

ModeSelectorText Gets or sets the text display before the mode selector

StartInPlainText Gets of sets a boolean value whether the control loads up in plain text mode. Default is False.

Page 101: Nintex Workflow 2007 SDK 1.2

Page 101 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Description

TextAreaCols Gets of sets the columns for the control.

TextAreaRows Gets of sets the rows for the control.

Width Get or set the width of the rendered field controls.

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 MODE_RTE

rte_setTextEditorMode(richTextEditorClientId, mode);

// Get the mode

var value = rte_getTextEditorMode(richTextEditorClientId);

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.

Page 102: Nintex Workflow 2007 SDK 1.2

Page 102 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

JavaScript (Setting the size)

<script language="javascript" event="onload" for="window">

rte_setSize("<%= richText1.ClientID %>", 500, 100);

</script>

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>

USER CHOOSER WEB CONTROL

This control allows the selection of people and groups, as well as workflow context lookups.

The UserChooserWebControl replaces the popup dialog for searching names, adding the ability to enter an external email

address or workflow context reference.

Nintex.Workflow.ApplicationPages.UserChooserWebControl

PROPERTIES

Name Description

AllowEmpty (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

AllowExternalEmailAddresses Gets or sets a Boolean that specifies if the panel for external email addresses is displayed.

AllowTypeIn (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

Page 103: Nintex Workflow 2007 SDK 1.2

Page 103 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Description

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.

MultiSelect (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

PlaceButtonsUnderEntityEditor (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

Rows (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

SelectionSet (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

ShowCreateButtonInActiveDirectoryAccountCreationMode

(Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

ValidateResolvedEntity (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

ValidatorEnabled (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

Width (Inherited from Microsoft.SharePoint.WebControls.PeopleEditor)

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

Page 104: Nintex Workflow 2007 SDK 1.2

Page 104 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

JavaScript (Usage)

var oValue = GetPeopleDataCollection(peopleEditorObject);

// Returns data of a specific login name that is selected in the people editor

var oValue = GetPersonDataCollection(peopleEditorObject, loginName);

// Attempt to resolve the values entered in the input box

peopleEditorCheckNames(peopleEditorClientID);

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.

Page 105: Nintex Workflow 2007 SDK 1.2

Page 105 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

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.

The JavaScript function GetPersonDataCollection returns an associative array of user details. GetPeopleDataCollection

returns an array of associative arrays of user details. Valid keys in the associative array are

SPUserID

Email

DisplayName

Department

SIPAddress

Title

PrincipalType

Username

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 Description

ButtonToDisable 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.

InstanceId Gets or sets the instance id of a workflow instance to render. Required when RenderStyle is Runtime.

ListId Gets or sets the ID of the list that the workflow to display is associated with. Required when RenderStyle is Statistics or Preview.

Page 106: Nintex Workflow 2007 SDK 1.2

Page 106 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Name Description

RenderStyle Gets or sets a value determining the mode to display the workflow in. Options are Preview, Runtime or Statistics. The default is Preview. Statistics can be used in enterprise licenses only. DesignTime is treated as Preview.

ShowMouseOverPopups Gets or sets a value determining whether to display mouse-over popups displaying summary information. Use in conjunction with CssLink and ScriptLink.

ShowPublishedVersion Gets or sets a Boolean value that specifies whether the published version of the workflow is displayed, or the latest saved version.

ShowWarnings Gets or sets a Boolean value that specifies whether to display any warnings detected in the workflow.

Statistics Gets or sets a WorkflowStatistics object to render. Required when RenderStyle is Statistics.

WorkflowId Gets or sets the base association ID of the workflow to render.

WorkflowName Gets or sets the name of the workflow to render.

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.

Page 107: Nintex Workflow 2007 SDK 1.2

Page 107 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

CLASS LIBRARY REFERENCE

NINTEX.WORKFLOW

NWCONTEXT

This object represents all the data required to replace context tokens in string. It is used from within a workflow activity.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

Context Gets the Microsoft.SharePoint.WorkflowActions.WorkflowContext that the context is built for.

InstanceID Gets the Instance ID of the workflow that the context is built for.

ItemID Gets the Item ID of the item that the context is built for.

ListID Gets the ID of the list that the context is built for.

Web Gets the SPWeb that the context is built for.

WorkflowInitiator Gets the SPUser who started the workflow.

WorkflowInstance Gets the SPWorkflow that the context is for.

METHODS

Name Description

AddContextDataToString 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 Gets a collection of all the available context tokens.

GetItemAsAttachment 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.

GetItemUrl Gets a string containing the display url of the context SPListItem.

EXAMPLES

The following example demonstrates creating a NWContext object and using it to resolve a string containing context tokens.

Page 108: Nintex Workflow 2007 SDK 1.2

Page 108 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

NWContext ctx = new NWContext(

this.__Context,

new Guid(this.ListId),

this.ListItem,

this.WorkflowInstanceId,

CurrentWorkflowVariableValues,

this);

string resolved = ctx.AddContextDataToString(unresolved);

Page 109: Nintex Workflow 2007 SDK 1.2

Page 109 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NWCONTEXTDATA

An object representing a single item of workflow context data.

Inheritance Hierarchy: Nintex.Workflow.NWContextKey

PROPERTIES

Name Description

Data The resolved value of the context data

Page 110: Nintex Workflow 2007 SDK 1.2

Page 110 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NWCONTEXTKEY

An object representing a workflow context item that can be inserted into a string and resolved at runtime.

Inheritance Hierarchy: System.IComparable

PROPERTIES

Name Description

Category Gets or sets a specifying the category of the context data. Recognised options are Common, WorkflowVariable, ItemProperty, and WorkflowConstant.

DataType Gets or sets a Microsoft.SharePoint.SPFieldType values representing the type of this context data.

DisplayName Gets or sets the friendly name of the context token.

Name Gets or sets the internal name of the context token.

METHODS

Name Description

CompareTo

REMARKS

When NWContext is used to replace tokens, it searches for tokens in the following format: {Category:Name}

Page 111: Nintex Workflow 2007 SDK 1.2

Page 111 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NWCONTEXTKEYCOLLECTION

A collection of NWContextKeys

Inheritance Hierarchy: System.Collections.Generic.List<NWContextKey>

METHODS

Name Description

DoesKeyExist Returns a Boolean if the collection contains a specific NWContextKey based on its Name and Category property.

Page 112: Nintex Workflow 2007 SDK 1.2

Page 112 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NINTEX.WORKFLOW.HUMANAPPROVAL

APPROVALAI

Handles the detection of LazyApproval terms in an SPEmailMessage.

Inheritance Hierarchy: System.Object

METHODS

Name Description

InterpretEmailResponse 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.

Page 113: Nintex Workflow 2007 SDK 1.2

Page 113 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPROVALTASK

Represents an assigned workflow task that requests approval.

Inheritance Hierarchy: Nintex.Workflow.HumanApproval.NintexTask

PROPERTIES

Name Description

ApprovalBehaviour Gets or sets the Nintex.Workflow.HumanApproval.ApprovalType for this task.

ApprovalBehaviourData Gets or sets a string supporting the ApprovalBehaviour. Will contain a number representing the required approval responses for a Vote ApprovalBehaviour.

METHODS

Name Description

ApprovalTask Constructor. Use NintexTask.RetrieveTask to obtain an instance of ApprovalTask.

CancelApprovalTask Cancels a task that is currently running.

ProcessResponse Registers a response to the task.

REMARKS

An instance of an approval task can be retrieved us

Page 114: Nintex Workflow 2007 SDK 1.2

Page 114 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPROVALTYPE ENUMERATION

Represents the behavior of a task regarding the number of users that must respond.

MEMBERS

Member name Description

AllMustApprove Every response must approve.

FirstToRespond The first responder determines the outcome.

AnyApprove If any approve is registered, the task is approved.

Vote A specified number of positive responses are required. ApprovalTask.ApprovalBehaviourData contains the required number.

Page 115: Nintex Workflow 2007 SDK 1.2

Page 115 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPROVER

Represents a task assignee.

Inheritance Hierarchy: Nintex.Workflow.HumanApproval.User

PROPERTIES

Name Description

AllowDelegation Gets or sets a value that determines if this approver is allowed to delegate the task.

ApprovalNoLongerRquiredMessage Gets or sets the Message that will be sent if the approver no longer needs to respond to a task.

ApprovalOutcome 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.

ApproverID The ID of this approver. Corresponds to an ID stored in the database.

Comments Gets or sets the comments the approver registered with this task.

EntryTime Gets the time that the task was assigned to the approver.

ExitTime Gets the time that the approver completed the task.

ParentTask The Nintex.Workflow.HumanApproval.NintexTask that this approver has been assigned to.

RequestApprovalMessage Gets or sets the Message that will be sent if to the approver when the task is assigned.

SPTaskId Gets the ID of the SPListItem task that this approver must complete.

METHODS

Name Description

Approver Creates an Approver and assigns them to the parentTask.

FlagTaskAsHidden Hides the specified task for the user from the ‘My Workflow Tasks’ webpart.

Update Commits property changes to the database. Optionally updates the SPListItem task with the Comments and ApprovalOutcome.

REMARKS

The term ‘Approver’ also refers to users assigned to Review tasks.

Page 116: Nintex Workflow 2007 SDK 1.2

Page 116 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

USERCONFIG

An object for storing limited details about a user. Used for assigning data to an Activity object.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

DisplayName

OtherEmailAddress

PrincipalType

User

Page 117: Nintex Workflow 2007 SDK 1.2

Page 117 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPROVERCONFIG

An object for storing limited details about an approved. Used for assigning data to an Activity object.

Inheritance Hierarchy: Nintex.Workflow.HumanApproval.UserConfig

PROPERTIES

Name Description

AllowDelegation

AllowLazyApprove

ApprovalNotRequiredMessage

ApprovalRequiredMessage

IsCustom

METHODS

Name Description

Copy

ToNWApprover

Page 118: Nintex Workflow 2007 SDK 1.2

Page 118 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELEGATION

Represents a delegation rule detailing a period where tasks assigned to a user are automatically delegated to another. Also

handles delegating tasks to other users.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

DelegateUsername Gets or sets the login name of the user who will have tasks delegated to them.

DelegationID Gets the ID of the delegation record. Corresponds to an ID stored in the database.

EndDate Gets or sets the date and time when the delegation rule will no longer apply.

EndDateDisplay Gets or sets a formatted string representation of EndDate.

Scope Gets a string representing the scope of the delegation rule.

SiteID 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.

StartDate Gets or sets the date and time from which the delegation rule will apply.

StartDateDisplay Gets a formatted string representation of StartDate.

Username Gets or sets the login name of the user who set up the delegation rule.

WebID Gets or sets the ID of the teamsite this delegation rule applies to. Set to Guid.Empty for a global rule.

METHODS

Name Description

DelegateApprovalTask Delegates an Approver to another user.

Delegation Constructor. Creates a new delegation rule. Update must be called to persist the new rule.

Delete Deletes the delegation rule.

FindDelegate 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.

Update Persists the property values to the database.

Page 119: Nintex Workflow 2007 SDK 1.2

Page 119 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Page 120: Nintex Workflow 2007 SDK 1.2

Page 120 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELEGATIONHISTORY

Represents a record of a delegation of a task from one user to another.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

ApproverID Gets the ApproverID that the delegation applied to.

Comment Gets a string of comments that were entered to explain the delegation.

DelegateUsername Gets the login name of the user whom the task was delegated to.

Username Gets the login name of the user who delegated the task.

Page 121: Nintex Workflow 2007 SDK 1.2

Page 121 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELIVERYMECHANISM ENUMERATION

Represents the preferred format of message delivery.

MEMBERS

Member name Description

None

Email

SMS

IM

UserPreference

Page 122: Nintex Workflow 2007 SDK 1.2

Page 122 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

MESSAGE

Represents a notification that is sent to a user.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

AllowLazyApprove Gets or sets a value indicating whether the message is LazyApproval enabled.

AttachFile Gets or sets a value indicating if the workflow item should be attached to the message.

Body Gets or sets the text of the notification body.

CcList Gets or sets a collection of users to include as CC recipients.

DeliveryType Gets or sets a value indicating the mode of delivery.

From Gets or sets the user from whom the message should be sent from.

IsHtmlMessage Gets or sets a value indicating if the message is in HTML format.

Subject Gets or sets the subject of the notification.

METHODS

Name Description

Copy

DecodeForLazyApproval Interprets a subject for a LazyApproval token.

DeSerialize

Send Sends a message.

Serialize

Page 123: Nintex Workflow 2007 SDK 1.2

Page 123 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NINTEXTASK

Represents a workflow task that a user or group of users must respond to.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

ApprovalStatus Gets the Nintex.Workflow.HumanApproval.Outcome of the task.

Approvers Gets the collection of users for the task.

EntryTime Gets the time and date that the task was created.

ExitTime Gets the time and date that the task was completed.

SequenceId Get a value that correlates the task to its position in the workflow.

WFContext Gets the context of the workflow and task.

METHODS

Name Description

GetPendingApprover Returns an Approver object from a User and a SharePoint task item ID.

RetrieveSPListItem Retrieves an SPListItem from a task list.

RetrieveTask Returns the NintexTask that is associated with a SPListItem task.

Page 124: Nintex Workflow 2007 SDK 1.2

Page 124 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

USERTASK

An object that stores base information regarding a task.

Inheritance Hierarchy: System.Object

PROPERTIES

Name Description

AssignedTo

Comments

EntryTime

HumanWorkflowID

SharePointTaskId

TaskName

TaskType

WorkflowInstaceId

WorkflowName

Page 125: Nintex Workflow 2007 SDK 1.2

Page 125 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

OUTCOME ENUMERATION

The states that a task or approver can be in.

MEMBERS

Member name Description

Approved

Rejected

Pending The task has not been responded to / the user has not yet registered a response.

Cancelled

NotRequired The approver is no longer required to respond to the task.

Continue Used to complete Review tasks.

Delegated

Page 126: Nintex Workflow 2007 SDK 1.2

Page 126 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REVIEWTASK

Represent a task that a user must complete, but does not have to make a decision.

Inheritance Hierarchy:Nintex.Workflow.HumanApproval.NintexTask

PROPERTIES

Name Description

ApprovalBehaviour Gets or sets the Nintex.Workflow.HumanApproval.ApprovalType for this task. The only valid values are AllMustApprove and AnyApprove.

METHODS

Name Description

CancelApprovalTask Cancels the review task.

ProcessResponse Registers a response to the task.

ReviewTask Constructor. Use NintexTask.RetrieveTask to obtain an instance of ApprovalTask.

Page 127: Nintex Workflow 2007 SDK 1.2

Page 127 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

TASKTYPE ENUMERATION

MEMBERS

Member name Description

Approval Specifies an approval task.

Review Specifies a review task.

Page 128: Nintex Workflow 2007 SDK 1.2

Page 128 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

USER

Represents a person or group.

Inheritance Hierarchy:System.IComparable

PROPERTIES

Name Description

DisplayName Gets or sets the display name of the user.

IsDomainGroup Gets or sets a value specifying if this user is a domain group.

IsSPGroup Gets or sets a value specifying if this user is a SharePoint group.

OtherEmailAddress Gets or sets the email address of the user.

SipAddress Gets or sets the SIP address of the user.

UserID Gets or sets the login name of the user.

METHODS

Name Description

CheckAUserMatchesHWUser Checks if a login name matches a user object.

CheckCurrentUserMatchesHWUser Checks if a user object matches the logged in user.

CompareTo

Copy

Page 129: Nintex Workflow 2007 SDK 1.2

Page 129 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

USERINFO

Utility object for users to ensure they exist in SharePoint.

Inheritance Hierarchy:System.Object

PROPERTIES

Name Description

User Gets the SPUser object of the user.

UserAssignString Gets a value of the SharePoint representation of a user in id;#loginname format.

METHODS

Name Description

UserInfo Constructor. Ensures a user is a member of a teamsite.

GetDisplayNameAndEmail Searches for the display name and email address of a loginname,

WhatTypeOfPrincipalAmI 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.

Page 130: Nintex Workflow 2007 SDK 1.2

Page 130 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

USERPREFERENCE

Represents a user’s preferences for notification.

Inheritance Hierarchy:System.Object

PROPERTIES

Name Description

AfterHours Gets or sets a value indicating a user’s preference for notifications out of business hours notifications.

BusinessHours Gets or sets a value indicating a user’s preference for notifications during business hours notifications.

SMSAddress Gets or sets the value to send SMS messages to.

METHODS

Name Description

UserPreference Constructor. Creates an instance of UserPreference for a given login name.

Update Persists the property values to the database.

Page 131: Nintex Workflow 2007 SDK 1.2

Page 131 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

WEB SERVICES

Nintex Workflow functionality can be accessed via web services. This is the preferred method of integration by third party

applications.

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

To access the Nintex Workflow web service’s WSDL

http://MyServer/[sites/][MySite/][MySubsite/]_vti_bin/NintexWorkflow/Workflow.a

smx?WSDL

For more information on SharePoint web service usage and coding see the Web Service Guidelines in the SharePoint SDK.

WEB SERVICE: WORKFLOW

Service Description

AddLongTermDelegationRule Adds a delegation rule for a user.

AddWorkflowSchedule Adds or updates a workflow schedule on a file in a document library.

AddWorkflowScheduleOnListItem Adds or updates a workflow schedules on a list item.

DelegateAllTasks Delegate all tasks assigned to a user to another.

DeleteLongTermDelegationRule Deletes a delegation rule for a user.

DeleteSnippet [System] Delete a snippet.

DeleteWorkflow [System] Delete a workflow.

ExportWorkflow Generates a workflow export file.

FixWorkflowsInSiteFromTemplate Run the fix for workflows in site templates.

GetItemsPendingMyApproval [System] Used by the Windows Vista Gadget for displaying a user's tasks.

GetOutcomesForFlexiTask Retrieves the available outcomes for a Flexi task action.

Page 132: Nintex Workflow 2007 SDK 1.2

Page 132 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Service Description

GetRunningWorkflowTasks Retrieves all workflow tasks associated with a file in a document library.

GetRunningWorkflowTasksCollection Retrieves all running workflow tasks.

GetRunningWorkflowTasksForCurrentUser Retrieves tasks assigned to the calling user that are associated with a document in a document library.

GetRunningWorkflowTasksForCurrentUserForListItem Retrieves tasks assigned to the calling user that are associated with a particular list item.

GetRunningWorkflowTasksForListItem Retrieves all workflow tasks associated with a list item.

GetWorkflowHistory Retrieves workflow history.

GetWorkflowHistoryForListItem Retrieves workflow history.

HideTaskForApprover [System] Flags a task to not be displayed on the 'My Workflow Tasks' web part.

ProcessFlexiTaskResponse Registers a response to a Flexi task action.

ProcessTaskResponse Obsolete. Registers a response to a workflow Approval or Review task in the default Nintex Workflow task list.

ProcessTaskResponse2 Registers a response to a workflow Approval or Review task in a custom Nintex Workflow task list.

PublishFromNWF Will publish a workflow from the contents of an exported workflow file.

PublishFromNWFNoOverwrite Will publish a workflow from the contents of an exported workflow file, and fail if a workflow with the same name already exists.

PublishFromNWFSkipValidation Will publish a workflow from the contents of an exported workflow file, skipping the SharePoint validation step.

PublishFromNWFSkipValidationNoOverwrite Will publish a workflow from the contents of an exported workflow file, skipping the SharePoint validation step, and fail if a workflow with the same name already exists.

PublishFromNWFXml Will publish a workflow from the XML contents of an exported workflow file.

PublishFromNWFXmlNoOverwrite Will publish a workflow from the XML contents of an exported workflow file, and fail if a workflow with the same name already exists.

PublishFromNWFSkipValidation Will publish a workflow from the XML contents of an exported workflow file, skipping the SharePoint validation step.

Page 133: Nintex Workflow 2007 SDK 1.2

Page 133 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Service Description

PublishFromNWFSkipValidationNoOverwrite Will publish a workflow from the XML contents of an exported workflow file, skipping the SharePoint validation step, and fail if a workflow with the same name already exists.

PublishWorkflow [System] Used by the workflow designer to publish a workflow.

QueryForMessages [System]

RemoveWorkflowSchedule Deletes a configured workflow schedule.

RemoveWorkflowScheduleOnListItem Deletes a configured workflow schedule.

RetrieveWorkflow [System] Returns the html required to render a workflow.

SaveFromNWF Will save a workflow from the contents of an exported workflow.

SaveFromNWFNoOverwrite Will save a workflow from the contents of an exported workflow, and fail if a workflow with the same name already exists.

SaveFromNWFXml Will save a workflow from the XML contents of an exported workflow.

SaveFromNWFXmlNoOverwrite Will save a workflow from the XML contents of an exported workflow, and fail if a workflow with the same name already exists.

SaveSnippet [System] Save a snippet.

SaveTemplate [System] Save a template.

SaveWorkflow [System] Used to save a workflow in the designer.

SnippetExists [System] Checks if the snippet exists.

StartWorkflow Starts a workflow on a file in a document library.

StartWorkflowOnListItem Starts a workflow on a list item.

TemplateExists [System] Checks if the template exists.

TerminateWorkflow [System]Terminates a running or errored workflow.

TerminateWorkflowByName Terminates a running or errored workflow that is on a file in a document library.

TerminateWorkflowByNameForListItem Terminates a running or errored workflow that is on a list item.

WorkflowExists *System+ Checks the workflow’s in use value against the list.

Page 134: Nintex Workflow 2007 SDK 1.2

Page 134 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ADDLONGTERMDELEGATIONRULE

Adds 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 is being created for.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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

Page 135: Nintex Workflow 2007 SDK 1.2

Page 135 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

public int AddWorkflowSchedule(

string fileUrl,

string workflowName,

string startDataXml,

Nintex.Workflow.Scheduling.Schedule schedule,

bool updateIfExists

)

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

Page 136: Nintex Workflow 2007 SDK 1.2

Page 136 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

C#

)

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.

Page 137: Nintex Workflow 2007 SDK 1.2

Page 137 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELETESNIPPET

[System] Deletes a snippet.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public void DeleteSnippet(

Guid snippetId

)

PARAMETERS

snippetId

A Guid that specifies the ID of the snippet.

Page 138: Nintex Workflow 2007 SDK 1.2

Page 138 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELEGATEALLTASKS

Delegates all tasks assigned to one user to another.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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

Page 139: Nintex Workflow 2007 SDK 1.2

Page 139 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SYNTAX

C#

Public void DeleteLongTermDelegationRule (

int id

)

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.

Page 140: Nintex Workflow 2007 SDK 1.2

Page 140 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Page 141: Nintex Workflow 2007 SDK 1.2

Page 141 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DELETEWORKFLOW

[System] Delete a workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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

Page 142: Nintex Workflow 2007 SDK 1.2

Page 142 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

EXPORTWORKFLOW

Generates a workflow export file for the specified workflow. This is the equivliant of exporting a workflow from the

workflow designer.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 143: Nintex Workflow 2007 SDK 1.2

Page 143 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

FIXWORKFLOWSINSITEFROMTEMPLATE

Automatically ‘fix’ workflows in a site that was created from a site template. The same option exists in the workflow gallery

UI.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public string FixWorkflowsInSiteFromTemplate()

PARAMETERS

This web method has no parameters

Page 144: Nintex Workflow 2007 SDK 1.2

Page 144 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETITEMSPENDINGMYAPPROVAL

[System] Used by the Windows Vista Gadget for displaying a user's tasks.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 145: Nintex Workflow 2007 SDK 1.2

Page 145 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETOUTCOMESFORFLEXITASK

Retrieves a list of all outcomes that have been configured for a Flexi task action.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 146: Nintex Workflow 2007 SDK 1.2

Page 146 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETRUNNINGWORKFLOWTASKS

Retrieves all workflow tasks associated with a file in a document library.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 147: Nintex Workflow 2007 SDK 1.2

Page 147 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETRUNNINGWORKFLOWTASKSCOLLECTION

Retrieves all running workflow tasks.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 148: Nintex Workflow 2007 SDK 1.2

Page 148 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETRUNNINGWORKFLOWTASKSFORCURRENTUSER

Retrieves tasks assigned to the calling user that are associated with a document in a document library.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 149: Nintex Workflow 2007 SDK 1.2

Page 149 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETRUNNINGWORKFLOWTASKSFORCURRENTUSERFORLISTITEM

Retrieves tasks assigned to the calling user that are associated with a particular list item.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 150: Nintex Workflow 2007 SDK 1.2

Page 150 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETRUNNINGWORKFLOWTASKSFORLISTITEM

Retrieves all workflow tasks associated with a list item.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 151: Nintex Workflow 2007 SDK 1.2

Page 151 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETWORKFLOWHISTORY

Retrieves workflow history.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 152: Nintex Workflow 2007 SDK 1.2

Page 152 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GETWORKFLOWHISTORYFORLISTITEM

Retrieves workflow history.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 153: Nintex Workflow 2007 SDK 1.2

Page 153 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HIDETASKFORAPPROVER

[System] Flags a task to not be displayed on the 'My Workflow Tasks' web part.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 154: Nintex Workflow 2007 SDK 1.2

Page 154 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PROCESSFLEXITASKRESPONSE

Registers a response to a workflow Flexi task.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 155: Nintex Workflow 2007 SDK 1.2

Page 155 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PROCESSFLEXITASKRESPONSE2

Registers a response to a workflow Flexi task.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 156: Nintex Workflow 2007 SDK 1.2

Page 156 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PROCESSTASKRESPONSE

Obsolete. Registers a response to a workflow Approval or Review task in the default Nintex Workflow task list

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 157: Nintex Workflow 2007 SDK 1.2

Page 157 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PROCESSTASKRESPONSE2

Registers a response to a workflow Approval or Review task in a custom Nintex Workflow task list.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 158: Nintex Workflow 2007 SDK 1.2

Page 158 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PROCESSTASKRESPONSE3

Registers a response to a workflow Approval or Review task in a custom Nintex Workflow task list.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 159: Nintex Workflow 2007 SDK 1.2

Page 159 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWF

Will publish a workflow from the contents of an exported workflow. If a workflow with the same name already exists, it will

be overwritten with a new version.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 160: Nintex Workflow 2007 SDK 1.2

Page 160 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFNOOVERWRITE

Will publish a workflow from the contents of an exported workflow file, and fail if a workflow with the same name already

exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 161: Nintex Workflow 2007 SDK 1.2

Page 161 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFSKIPVALIDATION

Will publish a workflow from the contents of an exported workflow file, skipping the SharePoint validation step.

This method is for advanced scenarios only. The validation step is the part of publishing that takes a long time when a large

workflow is published. Skipping this step can speed up the publish process. However, if a workflow could not publish due to

it size, it is possibly not going to be able to load at run time. Furthermore, validation errors (for example data type mis

matches) that would prevent the workflow from running will not be found if validation is skipped.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 162: Nintex Workflow 2007 SDK 1.2

Page 162 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFSKIPVALIDATIONNOOVERWRITE

Will publish a workflow from the contents of an exported workflow file, skipping the SharePoint validation step, and fail if a

workflow with the same name already exists.

This method is for advanced scenarios only. The validation step is the part of publishing that takes a long time when a large

workflow is published. Skipping this step can speed up the publish process. However, if a workflow could not publish due to

it size, it is possibly not going to be able to load at run time. Furthermore, validation errors (for example data type mis

matches) that would prevent the workflow from running will not be found if validation is skipped.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 163: Nintex Workflow 2007 SDK 1.2

Page 163 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFXML

Will publish 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 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.

Page 164: Nintex Workflow 2007 SDK 1.2

Page 164 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFXMLNOOVERWRITE

Will publish a workflow from the XML contents of an exported workflow file, and fail if a workflow with the same name

already exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 165: Nintex Workflow 2007 SDK 1.2

Page 165 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFXMLSKIPVALIDATION

Will publish a workflow from the XML contents of an exported workflow file, skipping the SharePoint validation step.

This method is for advanced scenarios only. The validation step is the part of publishing that takes a long time when a large

workflow is published. Skipping this step can speed up the publish process. However, if a workflow could not publish due to

it size, it is possibly not going to be able to load at run time. Furthermore, validation errors (for example data type mis

matches) that would prevent the workflow from running will not be found if validation is skipped.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 166: Nintex Workflow 2007 SDK 1.2

Page 166 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHFROMNWFXMLSKIPVALIDATIONNOOVERWRITE

Will publish a workflow from the XML contents of an exported workflow file, skipping the SharePoint validation step, and

fail if a workflow with the same name already exists.

This method is for advanced scenarios only. The validation step is the part of publishing that takes a long time when a large

workflow is published. Skipping this step can speed up the publish process. However, if a workflow could not publish due to

it size, it is possibly not going to be able to load at run time. Furthermore, validation errors (for example data type mis

matches) that would prevent the workflow from running will not be found if validation is skipped.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 167: Nintex Workflow 2007 SDK 1.2

Page 167 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PUBLISHWORKFLOW

[System] Used by the workflow designer to publish a workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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>

Page 168: Nintex Workflow 2007 SDK 1.2

Page 168 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

QUERYFORMESSAGES

[System]

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 169: Nintex Workflow 2007 SDK 1.2

Page 169 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REMOVEWORKFLOWSCHEDULE

[System]

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 170: Nintex Workflow 2007 SDK 1.2

Page 170 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REMOVEWORKFLOWSCHEDULEONLISTITEM

[System]

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 171: Nintex Workflow 2007 SDK 1.2

Page 171 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

RETRIEVEWORKFLOW

[System] Returns the html required to render a workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 172: Nintex Workflow 2007 SDK 1.2

Page 172 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

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 SaveFromNWF (

byte[] workflowFile,

string listName,

string 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.

Page 173: Nintex Workflow 2007 SDK 1.2

Page 173 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVEFROMNWFNOOVERWRITE

Will save a workflow from the contents of an exported workflow, and fail if a workflow with the same name already exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public Guid SaveFromNWFNoOverwrite (

byte[] workflowFile,

string listName,

string 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.

Page 174: Nintex Workflow 2007 SDK 1.2

Page 174 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVEFROMNWFXML

Will save a workflow from the XML contents of an exported workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public Guid SaveFromNWFXml(

string workflowFile,

string listName,

string 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.

Page 175: Nintex Workflow 2007 SDK 1.2

Page 175 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVEFROMNWFXMLNOOVERWRITE

Will save a workflow from the XML contents of an exported workflow, and fail if a workflow with the same name already

exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public Guid SaveFromNWFXml(

string workflowFile,

string listName,

string 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.

Page 176: Nintex Workflow 2007 SDK 1.2

Page 176 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVESNIPPET

[System] Save a snippet.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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>

Page 177: Nintex Workflow 2007 SDK 1.2

Page 177 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVETEMPLATE

[System] Save the template.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public void SaveTemplate(

string templateName,

string templateDescription,

string category,

string 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>

Page 178: Nintex Workflow 2007 SDK 1.2

Page 178 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SAVEWORKFLOW

[System] Used to save a workflow in the designer.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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>

Page 179: Nintex Workflow 2007 SDK 1.2

Page 179 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SNIPPETEXISTS

[System] Checks if the snippet exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 180: Nintex Workflow 2007 SDK 1.2

Page 180 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STARTWORKFLOW

Starts a workflow on a file in a document library.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public Guid StartWorkflow(

string fileUrl,

string workflowName,

string 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.

Page 181: Nintex Workflow 2007 SDK 1.2

Page 181 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

STARTWORKFLOWONLISTITEM

Starts a workflow on a list item.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

SYNTAX

C#

public Guid StartWorkflowOnListItem(

string itemId,

string listName,

string workflowName,

string 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.

Page 182: Nintex Workflow 2007 SDK 1.2

Page 182 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

TEMPLATEEXISTS

[System] Checks if the template exists.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 183: Nintex Workflow 2007 SDK 1.2

Page 183 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

TERMINATEWORKFLOW

Terminates a running or errored workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 184: Nintex Workflow 2007 SDK 1.2

Page 184 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

TERMINATEWORKFLOWBYNAME

Terminates a running or errored workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 185: Nintex Workflow 2007 SDK 1.2

Page 185 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

TERMINATEWORKFLOWBYNAMEFORLISTITEM

Terminates a running or errored workflow.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 186: Nintex Workflow 2007 SDK 1.2

Page 186 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

WORKFLOWEXISTS

*System+ Checks the workflow’s in use value against the list.

Web Reference: http://<Site>/_vti_bin/NintexWorkflow/workflow.asmx

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.

Page 187: Nintex Workflow 2007 SDK 1.2

Page 187 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORT DEFINITION SCHEMA

Nintex Workflow Enterprise edition includes enterprise reporting. Via SharePoint Central Administration an administrator is

able to upload new reports. These report definition files contain Xml based on the schema below.

The following section details the schema for a report definition. There is also an Xsd file deployed as a support resource in

this SDK. The file can be accessed from {SDK location}\support\ReportDefinition.xsd.

REPORT DEFINITION ELEMENTS

ReportDefinition

AllowCaching

CacheTimeOut

SqlQuery

QueryType

PageSize

AllowSorting

JoinType

PagingMode

DefaultSortExpression

Scope

ReportColumns

ReportColumn

GroupOperator

UrlFormatString

FormatString

UrlColumnNames

SortExpression

Sortable

Name

DisplayName

DisplayType

IsTextColumn

Page 188: Nintex Workflow 2007 SDK 1.2

Page 188 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

IsValueColumn

ReportParameters

ReportParameter

DisplayName

Name

Value

ParameterType

Required

Page 189: Nintex Workflow 2007 SDK 1.2

Page 189 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORTDEFINITION

Top-level element that contains the definition of a report definition.

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>

Page 190: Nintex Workflow 2007 SDK 1.2

Page 190 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ALLOWCACHING

Specifies if the report data should be cached.

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>

Page 191: Nintex Workflow 2007 SDK 1.2

Page 191 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

CACHETIMEOUT

Specifies the cache timeout of the report data.

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>

Page 192: Nintex Workflow 2007 SDK 1.2

Page 192 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SQLQUERY

The Sql query to execute.

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>

Page 193: Nintex Workflow 2007 SDK 1.2

Page 193 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

QUERYTYPE

Specifies how a command string is interpreted.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportDefinition

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Text An SQL text command.

StoredProcedure The name of a stored procedure.

TableDirect 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>

Page 194: Nintex Workflow 2007 SDK 1.2

Page 194 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PAGESIZE

Specifies the page size used when returning the data.

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>

Page 195: Nintex Workflow 2007 SDK 1.2

Page 195 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ALLOWSORTING

Specifies if sorting should be enabled in the grid view.

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>

Page 196: Nintex Workflow 2007 SDK 1.2

Page 196 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

JOINTYPE

Since Nintex Workflow supports multiple content databases it is necessary to define how results from these databases are

joined.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportDefinition

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Union Results from all content databases are retuned sequentially.

Group 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>

Page 197: Nintex Workflow 2007 SDK 1.2

Page 197 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PAGINGMODE

Specifies the mode which should be used for paging.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportDefinition

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Inbuilt Use the default paging in SPGridView when rendering results, the stored procedure must return the full result set.

Custom The stored procedure must support returning pages of results by specifying parameters.

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>

Page 198: Nintex Workflow 2007 SDK 1.2

Page 198 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DEFAULTSORTEXPRESSION

Specify the default column to sort by.

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>

Page 199: Nintex Workflow 2007 SDK 1.2

Page 199 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SCOPE

Defines the scope of the report.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportDefinition

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Local The report will be executed only on the current web’s Nintex Workflow content database.

Farm The report will be executed on all Nintex Workflow content databases.

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>

Page 200: Nintex Workflow 2007 SDK 1.2

Page 200 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORTCOLUMNS

Top level element that contains the definition of report columns.

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>

Page 201: Nintex Workflow 2007 SDK 1.2

Page 201 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORTCOLUMN

Describes a column to be returned in the report.

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>

Page 202: Nintex Workflow 2007 SDK 1.2

Page 202 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GROUPOPERATOR

The arithmetic operator to be applied when grouping results.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportColumn

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Key Defines that this column should not be grouped.

Sum

Min

Max

Count

First

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>

Page 203: Nintex Workflow 2007 SDK 1.2

Page 203 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

URLFORMATSTRING

The template of the Url with format items which are replaced with values specified in UrlColumnNames.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportColumn

OCCURRENCES

Minimum: 0 Maximum: 1

EXAMPLE

Xml

<ReportColumn>

<GroupOperator>Key</GroupOperator>

<UrlFormatString>/_layouts/NintexWorkflow/Redirect.aspx?View

=WorkflowStatus&amp;InstanceID={0}&amp;SiteID={1}&amp;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>

Page 204: Nintex Workflow 2007 SDK 1.2

Page 204 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

FORMATSTRING

The standard .net format sting to be passed to the ToString operator when rendering the field.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportColumn

OCCURRENCES

Minimum: 0 Maximum: 1

Page 205: Nintex Workflow 2007 SDK 1.2

Page 205 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

URLCOLUMNNAMES

Specifies the columns names used to replace the format items in UrlFormatString.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportColumn

OCCURRENCES

Minimum: 0 Maximum: 1

EXAMPLE

Xml

<ReportColumn>

<GroupOperator>Key</GroupOperator>

<UrlFormatString>/_layouts/NintexWorkflow/Redirect.aspx?View

=WorkflowStatus&amp;InstanceID={0}&amp;SiteID={1}&amp;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>

Page 206: Nintex Workflow 2007 SDK 1.2

Page 206 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SORTEXPRESSION

Specifies the sort expression that is used by a data source control to sort data.

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>

Page 207: Nintex Workflow 2007 SDK 1.2

Page 207 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

SORTABLE

Specifies if the column allows sorting.

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>

Page 208: Nintex Workflow 2007 SDK 1.2

Page 208 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NAME

Specifies the internal name of the data item.

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>

Page 209: Nintex Workflow 2007 SDK 1.2

Page 209 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DISPLAYNAME

Specifies the display name of the data item in the grid view.

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>

Page 210: Nintex Workflow 2007 SDK 1.2

Page 210 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DISPLAYTYPE

Specifies the type of data to be rendered in the grid view, to ensure the data is correctly represented.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportColumn

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Default

Person

TimeSpan

Number

Hidden

Hyperlink

SiteIDandWebID

DateTime

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>

Page 211: Nintex Workflow 2007 SDK 1.2

Page 211 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ISTEXTCOLUMN

Identifies this column as a key text field used when generating charts.

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>

Page 212: Nintex Workflow 2007 SDK 1.2

Page 212 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ISVALUECOLUMN

Identifies this column as a value field used when generating charts.

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>

Page 213: Nintex Workflow 2007 SDK 1.2

Page 213 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORTPARAMETERS

Top level element that contains the definition of report parameters.

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>

Page 214: Nintex Workflow 2007 SDK 1.2

Page 214 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REPORTPARAMETER

Defines a parameter for the report.

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>

Page 215: Nintex Workflow 2007 SDK 1.2

Page 215 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DISPLAYNAME

The display value rendered in the UI for this parameter.

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>

Page 216: Nintex Workflow 2007 SDK 1.2

Page 216 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

NAME

Specifies the stored procedure parameter name.

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>

Page 217: Nintex Workflow 2007 SDK 1.2

Page 217 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

VALUE

Specifies the default value for this parameter.

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>

Page 218: Nintex Workflow 2007 SDK 1.2

Page 218 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

PARAMETERTYPE

Specifies the value type of the parameter.

CHILD ELEMENTS

None

PARENT ELEMENTS

ReportParameter

OCCURRENCES

Minimum: 1 Maximum: 1

VALUES

Value Description

Integer

String

Person

Workflow This identifies this as a workflow Guid

Site This identifies this as a site Guid

Web This identifies this as a web Guid

EXAMPLE

Xml

<ReportParameter>

<DisplayName>Initiator</DisplayName>

<Name>@WorkflowInitiator</Name>

<ParameterType>Person</ParameterType>

<Required>false</Required>

</ReportParameter>

Page 219: Nintex Workflow 2007 SDK 1.2

Page 219 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

REQUIRED

Specifies if the parameter is required.

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>

Page 220: Nintex Workflow 2007 SDK 1.2

Page 220 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

DATABASE SCHEMA

This section details the two types of databases that store Nintex Workflow information. The configuration database is the

central database which contains global settings. There can only be one configuration database per SharePoint farm.

The second type of database is the content database and stores active information about workflows and their history.

There can be 1 or more content databases per farm.

Note: The configuration database is also used as a content database. Following the default installation guidelines, only a

single (configuration/content) database is created for Nintex Workflow.

CONFIGURATION DATABASE

TABLES

This section describes the database tables used to store configuration information for Nintex Workflow at the farm level.

Activities

This table lists the workflow actions that are available for enabling in the workflow designer.

Column Type Description

ActivityID int – Identity

ActivityName nvarchar (255) The display name of the action.

Category nvarchar (255) The group in which the action belongs in the toolbox.

Description nvarchar (255)

ActivityType nvarchar (255) The class of the workflow activity.

ActivityAssembly nvarchar (255) The assembly containing the activity class.

AdapterType nvarchar (255) The class of the action adapter.

AdapterAssembly nvarchar (255) The assembly containing the adapter class.

HandlerUrl nvarchar (255)

Icon nvarchar (255)

IconWarning nvarchar (255)

IconToolbox nvarchar (255)

RenderBehaviour tinyint Reserved for internal use only.

ConfigPage nvarchar (255)

QuickAccess bit 1 to display the action in the ‘Commonly used’ category.

Page 221: Nintex Workflow 2007 SDK 1.2

Page 221 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Activities

ListTypeFilter int Specify 1 to restrict the action to only display in the action toolbox when the workflow is being designed for a document library.

RequiredFeatureSet int The license required to see the action. 100 specifies that an Enterprise license.

ActivityActivation

This table defines which actions are available for use on different teamsites.

Columns Type Description

ActivityActivationID int - Identity

ActivityID int The ID of the action that the entry is for.

SiteID uniqueidentifier Identifier of the site collection.

WebID uniqueidentifier Identifier of the teamsite.

ActivityResources

Reserved for future use.

Column Type Description

ActivityID int

Category nvarchar (255)

Description nvarchar (255)

Icon nvarchar (255)

IconWarning nvarchar (255)

IconToolbox nvarchar (255)

LCID smallint

Page 222: Nintex Workflow 2007 SDK 1.2

Page 222 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

ApprovalAI

This table holds the recognized responses for the LazyApproval system.

Column Type Description

ApprovalAIRuleID int - Identity

SiteID uniqueidentifier Identifier of the site collection that the term is valid for.

WebID uniqueidentifier Identifier of the teamsite that the term is valid for.

Phrase nvarchar (255) The term that is recognized.

Outcome bit 1 if the term is recognized as an approve, 0 if the term is recognized as a reject.

CustomContextData

This table stores custom context data items that have been registered with Nintex Workflow.

Column Type Description

ID int - Identity

TypeName nvarchar (255)

AssemblyName nvarchar (255)

Databases

This table stores the connection details for each content database.

Column Type Description

DatabaseID int - Identity

DatabaseName nvarchar (255)

ServerName nvarchar (255)

Username nvarchar (255) The username to use if UseIntegrated is false.

Password nvarchar (255) The password to use if UseIntegrated is false.

UseIntegrated bit

Page 223: Nintex Workflow 2007 SDK 1.2

Page 223 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Delegation

This table stores the list of static delegations that been set up by users.

Column Type Description

DelegationID int - Identity

Username nvarchar (255) The login name of the user whose tasks will be delegated.

StartDate datetime The date and time from which the delegation is valid for.

EndDate datetime The date and time until which the delegation is valid for.

SiteID uniqueidentifier Identifier of the site collection where the delegation will be applied to the task.

WebID uniqueidentifier Identifier of the teamsite where the delegation will be applied to tasks.

Delegate nvarchar (255) The login name of the user whom tasks will be assigned to in the specified timeframe.

GlobalSettings

This table stores configuration settings.

Column Type Description

SMTPServer nvarchar (255) The address of the smtp server used to send emails.

FromAddress nvarchar (255) The address from which notifications are sent.

ReplyAddress nvarchar (255) The reply to address for notifications.

RTCSourceMailAddress nvarchar (255)

RTCSourceDomainUser nvarchar (255)

RTCSourceDomainUserPassword nvarchar (255)

RTCSourceIMServer nvarchar (255)

RTCSourceIMTransport nvarchar (255)

EnforceSafeLoop bit 1 to specify that a delay action must be inserted at the bottom of loops and state machines.

Page 224: Nintex Workflow 2007 SDK 1.2

Page 224 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

GlobalSettings

DefaultTaskListName nvarchar (255) The default task list that Nintex Workflow uses when a workflow is created. A task list with this name will be created when Nintex Workflow is activated on a teamsite if it does not exist.

AllowStaticDelegation bit 1 to allow users to set up delegations over a period of time.

AllowNotificationPreferences bit 1 to allow users to define their notification preferences.

NeedDesignerRightsForSchedules bit 1 to specify that web designer rights are required to create schedules.

TaskViewName nvarchar (255) The view name that the Item Properties control on the default approver / reject page will look for when determining which properties to display.

LazyApprovalFooter nvarchar (255) The text appended to a notification that is LazyApproval enabled.

Holidays

This table stores the holidays that have been defined. Holidays are used when determining ‘business hours’.

Column Type Description

HolidayID int - Identity

HolidayName nvarchar (255)

HolidayDate datetime

RepeatYearly bit

WebId uniqueidentifier

SiteId uniqueidentifier

LazyApprovalIgnoreTerms

This table stores the terms that LazyApproval checks an incoming message subject for to determine if it should discard the message.

Column Type Description

Id int - Identity

Term nvarchar (255) The text to search a subject for.

Page 225: Nintex Workflow 2007 SDK 1.2

Page 225 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Page 226: Nintex Workflow 2007 SDK 1.2

Page 226 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

MessageTemplates

This table stores the message templates used in all notifications.

Column Type Description

TemplateID int - Identity

MessageRequireApproval text The default message for an approval email notification.

Header nvarchar (1500) Header text pre pended to all email notifications.

Footer nvarchar (1500) Footer text appended to all email notifications.

MessageNoLongerRequired text The default message for an approval no longer required email notification.

SiteID uniqueidentifier Identifier of the site collection where the message settings will be used.

WebID uniqueidentifier Identifier of the teamsite where the message settings will be used.

Reports

Lists the reports available to the reporting webparts. Reporting functionality is available for Enterprise licenses only.

Column Type Description

ID int - Identity

Title nvarchar (256) The display name of the report.

Description nvarchar (256)

Role nvarchar (256) The domain group that users must be a member of to view the report.

DefinitionXML text The definition of the report.

Enabled bit 1 to allow users to select the report in the report webparts.

ReportType nvarchar (256) }

Page 227: Nintex Workflow 2007 SDK 1.2

Page 227 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

RTCMessageQueue

This table stores the message in queue for Real Time Communication clients (Microsoft Office Communication Server [OCS] and Microsoft Live Communication Sever [LCS]).

Column Type Description

MessageID int - Identity

Message text

SIPAddress nvarchar (255)

EmailAddress nvarchar (255)

Created datetime

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 Type Description

DatabaseID int

SiteID uniqueidentifier

UserPreference

Stores preferences set by a user.

Column Type Description

Username nvarchar (255) The login name of the user that the settings apply to.

Afterhours tinyint The notification preference for messages that are sent out of business hours.

Businesshours tinyint The notification preference for messages that are sent during business hours.

SMSAddress nvarchar (255) The address to send sms messages to for the user.

Page 228: Nintex Workflow 2007 SDK 1.2

Page 228 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

Version

Internal user only. This table stores the database version.

Column Type Description

Version nvarchar (50)

WorkflowConstants

This table stores the workflow constants that have been defined.

Column Type Description

ID int - Identity

Title nvarchar (255) The name of the workflow constant.

Description nvarchar (4000)

Value nvarchar (4000) The value that is used to replace the constant at runtime.

Sensitive bit 1 if the value is encrypted.

SiteId uniqueidentifier

WebId uniqueidentifier

Type nvarchar (255) The data type of the constant.

WorkflowSchedule

This table stores the workflow schedules.

Column Type Description

ScheduleId int - Identity

ItemId int The item ID that the schedule is defined on.

ListId uniqueidentifier The list ID of the list containing the item that the schedule is defined on.

WebId uniqueidentifier The ID of the teamsite that contains the item that the schedule is defined on.

SiteId uniqueidentifier The ID of the sitecollection that contains the item that the schedule is defined on.

WorkflowId uniqueidentifier The ID of the workflow that the schedule executes.

Page 229: Nintex Workflow 2007 SDK 1.2

Page 229 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

WorkflowSchedule

NextRunTime datetime When the schedule will next execute.

Schedule ntext XML representing the details of the schedule.

StartData ntext XML representing data that will be passed to the workflow when the schedule runs.

ModifiedBy nvarchar (255) The login name of the user who last modified the schedule.

Page 230: Nintex Workflow 2007 SDK 1.2

Page 230 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

CONTENT DATABASE

This section describes the database tables used to store workflow progress and task information.

TABLES

This table stores information related to delegation history.

DelegationHistory

This table stores a record of task delegations.

Column Type Description

DelegationHistoryID int - Identity

Username nvarchar (255) The login name of the user who delegated the task.

Delegate nvarchar (255) The login name of the user who had the task delegated to them.

Comment varchar (1024) The comments entered by the user to explain the delegation.

ApproverID bigint The identifier of the task approver that the delegation applies to.

DatabaseID int

DelegationDate datetime A timestamp of when the delegation occurred.

HumanWorkflow

This table stores information about tasks that have been assigned.

Column Type Description

HumanWorkflowID bigint - Identity

ApprovalType tinyint The rules for task completion. Value corresponds to a member of Nintex.Workflow.HumanApproval.ApprovalType.

EntryTime datetime The time and date that the task was assigned.

ExitTime datetime The time and date that the task was completed.

Outcome tinyint The outcome of the task. Value corresponds to a member of Nintex.Workflow.HumanApproval.Outcome

WorkflowTaskID int

Page 231: Nintex Workflow 2007 SDK 1.2

Page 231 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HumanWorkflow

WorkflowProgressID bigint The workflow action that the task is associated with.

ApprovalData nvarchar (255) If ApprovalType is Vote, the number of required approvals are stored here.

TaskType tinyint The type of task. Values corresponds to a member of Nintex.Workflow.HumanApproval.TaskType.

HumanWorkflowApprovers

This table stores information about each user that is assigned to a task.

Column Type Description

ApproverID bigint - Identity

HumanWorkflowID bigint The workflow task that the user is associated to.

Username nvarchar (255) The login name or group name of the approver.

EmailAddress nvarchar (1024) The email address of the approver.

EntryTime datetime The date and time when the task was assigned.

ExitTime datetime The data and time when the approver responded.

Comments nvarchar (1024) The comments entered by the user when registering their response.

Outcome tinyint The response the user entered. Value corresponds to a member of Nintex.Workflow.HumanApproval.Outcome.

ApprovalRequiredMessageTemplate text The approval required message that was sent to this user.

NoLongerRequiredMessageTemplate text The approval not required message that was sent to this user.

AllowDelegation bit 1 if this approver is allowed to delegate the task.

IsDomainGroup bit 1 if this approver is a domain group.

IsSPGroup bit 1 if this user is a SharePoint group.

SPTaskID int The ID of the SharePoint task item that represents the task.

Page 232: Nintex Workflow 2007 SDK 1.2

Page 232 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

HumanWorkflowApprovers

TaskDeleted bit 1 if this task should not be displayed on the ‘My Workflow Tasks’ webpart.

Version

Internal user only. This table stores the database version.

Column Type Description

Version nvarchar (50)

WorkflowInstance

This table stores information about every workflow that is run.

Column Type Description

InstanceID bigint - Identity

XOML text The version of the Xoml file this workflow uses.

SiteID uniqueidentifier The ID of the site collection that the workflow was run on.

ListID uniqueidentifier The ID of the list containing the item that the workflow was run on.

ItemID int The ID of the list item that the workflow was run on.

WebID uniqueidentifier The ID of the teamsite that the workflow was run on.

StartTime datetime A timestamp of when the workflow was started.

WorkflowInstanceID uniqueidentifier The ID used to identify the workflow instance in SharePoint.

WorkflowData image Obsolete.

WorkflowInitiator nvarchar (50) The login name of the user who started the workfklow.

WorkflowName nvarchar (255) The display name of the workflow that was started.

WorkflowID Uniqueidentifier The ID of the workflow that was started.

State int The current state of the workflow. Value corresponds to a member of Microsoft.SharePoint.Workflow.SPWorkflowState.

Page 233: Nintex Workflow 2007 SDK 1.2

Page 233 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

WorkflowInstance

Rules text The version of the Rules file this workflow uses.

ConfigXml text The configuration xml that was used when publishing the workflow into SharePoint.

ExpectedDuration int The number of minutes that the workflow is expected to take.

WorkflowProgress

This table stores a log of every action that is run in a workflow.

Column Type Description

WorkflowProgressID bigint – Identity

InstanceID bigint The ID of the workflow instance the action is associated with.

ActivityID int The ID of the action type that this action is. See Activities table in the configuration database.

WorkflowData image Obsolete.

ActivityComplete bit 1 if the action has finished executing.

TimeStamp datetime The time the action was run.

SequenceID int An identifier that associates an action with its position in the workflow.

CurrentActivityTitle nvarchar (255) The name assigned to the action in the workflow designer.

ExpectedDuration int The number of minutes that the action is expected to take.

Page 234: Nintex Workflow 2007 SDK 1.2

Page 234 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPENDICES

APPENDIX A: START A WORKFLOW FROM THE SHAREPOINT OBJECT MODEL

Starting workflows is done from the SharePoint object model without any need to reference the Nintex Workflow code

base.

There is a StartWorkflow method of the SPWorkflowManager class. The msdn link is http://msdn.microsoft.com/en-

us/library/ms435535.aspx.

Starting a workflow

SPSite site = …;

SPWorkflowManager workflowManager = site.WorkflowManager;

workflowManager.StartWorkflow(SPListItem, SPWorkflowAssociation,

associationData)

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.

Page 235: Nintex Workflow 2007 SDK 1.2

Page 235 of 235 www.nintex.com [email protected] connect.nintex.com

© 2008 Nintex LLC, All rights reserved. Errors and omissions excepted.

Software Development Kit v1.2

APPENDIX B: WORKFLOW START DATA FORMAT

When starting a workflow with start data through the API, the values for each start data item can be specified in an XML

format. The same format is used in a number of Nintex Workflow web service methods that are related to starting

workflows.

The following is an example of the workflow start data format:

Start Data xml example

<Data> <StartDataItem1>value1</StartDataItem1> <StartDataItem2>value2</StartDataItem2> <StartDataItem3>value3</StartDataItem3>

</Data>

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. Open SharePoint Designer to the site that holds the workflow

2. Expand Workflows\NintexWorkflow\

3. Open the folder with the same name as your workflow

4. Open the file with the same name as your workflow and an extension of .xoml.wfconfig.xml

5. 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.