Showing posts with label Nintex Workflow. Show all posts
Showing posts with label Nintex Workflow. Show all posts

January 16, 2013

Start a workflow on an item in another list

Some quick notes on how I start a workflow on an item from either a site workflow or a workflow on a different list:

Add a Call web service action fill in the URL as Web URL/_vti_bin/NintexWorkflow/Workflow.asmx”. Either enter a username and password or use stored credentials and click Refresh. Select the web method StartWorkflowOnListItem. Fill in as follows:
  • itemID: an integer variable containing the Item ID of the item you want to start the workflow on.
  • listName: I like to use the unique ID of the list instead of the actual name, e.g.: {12345abc-4524-4657-b4ac-c324aaf1ebca}, include curly brackets (decoder/encoder).
  • workflowName: the name of the workflow to start.
  • associationData: leave blank if there are no start variables on the target workflow. Otherwise include a single line text variable containing any necessary start variables formatted like this:
               <Data>
               <variable name>{local variable containing desired value}</variable name>
               </Data>
  • Encode inserted tokens: This may need to be checked if you get the following error when attempting to initiate the subsequent workflow: "Error returned from server: The remote server returned an error: (400) Bad Request."

More detailed information on Nintex.com: http://connect.nintex.com/files/folders/16832/download.aspx

January 09, 2013

Workflow Status Values

When trying to filter based on a workflow status I need to know what the numeric value is behind the text.  I find this helpful when setting up views or site workflows for doing automated cleanup of old list items.

For example if I want filter for incomplete workflows I can filter WF Status Column not equal to 5.

This list of status Name/Value pairs is from MSDN:
0 - Not Started
1 - Failed on Start
2 - In Progress
3 - Error Occurred
4 - Canceled
5 - Completed
6 - Failed on Start (retrying)
7 - Error Occurred (retrying)
15 - Canceled
16 - Approved
17 - Rejected

I didn't see this on MSDN, but if a workflow has not been initiated on a list item the field content is Null.  Filter for "is/is not empty" if that's the case.  Also, this isn't a Nintex setting, but I use it all the time with Nintex workflows.

December 06, 2012

Nintex Query List filtered by Person

When using Nintex Workflow and trying to use a Query List action and filtering by Person it's tricky to figure out how the workflow is reading the person field.  Here's how I successfully setup the filter:

A person variable is populated earlier in the workflow (I'll call it perPerson)...
  1. Create a Text Variable (I'll call it txtPerson)
  2. Set Variable action: Set txtPerson = perPerson - User ID Number
  3. Query List action: create filter [Person field] is equal to txtPerson

October 11, 2012

Switch to Claims Based Authentication and Nintex

If you're making the switch to Claims-based authentication in SharePoint, be prepared for lots of manual clean-up especially with Nintex (about 20 hours total for one web application with several workflows).  Here are a few things I found:
  • Authenticated Users (if used for access) needs to be re-setup
  • Nintex Workflows need to be republished
  • Some Workflows need to be restarted
  • This was about as messy as upgrading from 2007 to 2010.
Be sure to run this in test prior to production... If you're not 100% comfortable with the procedure below, I suggest going through the trouble of making a copy of your production environment... I know that can be a lot of work, but may be worth it since switching back from claims-based is not supported.

To make the switch to claims based authentication I used the steps provided by the MDSN library.  I used the steps listed in Tip 2 from the article... here is the process I used for a single web server:
  1. Log on to the SharePoint server with the Farm Admin account.
  2. In SharePoint Management Shell, run "get-SPWebApplication" and note the one to switch.
  3. Run the PowerShell script in the MSDN article and then after the $wa.MigrateUsers($true), run $wa.ProvisionGlobally().
  4. Once I was then able to log on with an admin account I starting verifying/updating "Authenticated Users" on the site and subsites, Search, and MySites.  In Claims based, Authenticated Users is now, "All Authenticated Users".
  5. Once things settle down, check all of your Alternate URLs... you might want to do this with a clean profile so any cached credentials aren't showing false problems... or delete them using Credendial Manager in control panel.
  6. Also check any outlook connections or mapped drives (drive mapped to a document library).
  7. Check the application event log for errors.
  8. Use the ULS logs for any errors you see with Correlation IDs.
  9. For Nintex I had several errors... but basically the same thing multiple times, "Object reference not set to an instance of an object" for scheduled workflows, as well as opening workflows for editing.  To resolve I opened the workflow, exported the entire workflow to a file, created a new workflow, imported the file, then published the new workflow replacing the old one.  Any stored credentials will need to be verified.  In several cases I then had to restart workflows that were running at the time of the switch to Claims.  I ended up rebuilding one older workflow because it was faster than troubleshooting each step... and it needed it anyway.

September 28, 2012

Modifying the Workflow Task Item Properties


A task in Nintex Workflow can be setup to display fields from the original task item... that is the Item Properties as shown in this screenshot:


Changing this list is pretty simple if you're familiar with views.  The trick is knowing which view to add/edit:
  1. Open up SharePoint Central Administration
  2. Under Nintex Workflow Management, click Global Settings.
  3. Scroll down and find "Task Form Properties View"
  4. Note the view in that field.
  5. Close Central Admin.
That view likely doesn't exist on the source list so create one and name it the same as listed in Central Administration.

September 07, 2012

Missing Nintex Workflow Controls

I was "messing" with the display properties of a list and when I went to do some work on a workflow I found the Nintex Workflow controls were gone!  I found they were still available on other lists/libraries on the site.  I still tried removing and readding them in the site features, but still missing.


A quick search turned up this entry on Nintex Connect.  I had modifed the toolbar on the list... so I clicked Site Actions --> Edit Page and changed the list webpart properties back to Full Toolbar.  That restored Create a Workflow and Manage Workflows with Nintex Workflow.

April 26, 2012

Workflow email to multiple recipients

I have a Nintex workflow which has a task to email multiple recipients.  In Workflow 2007 I used a single line text variable to store the user accounts then dumped them into the "To" box and went along my merry way.  I've since upgraded the workflow to 2010 and it continued to work until I made a modification to the email task.  Now I get the following error message:

Failed to send notification. Cannot get the full name or e-mail address of user "x".  (I think x is the user's sharepoint ID number).


If I dump the variable to the workflow history I see the following:

x;#user display name;#x;#user display name


I figured a key to the solution was to use the "Person or Group" variable, but no difference.  After a quick dialog with Nintex Technical Support I did use the new variable, but the trick is to use the elipse (...) button to specify that I want to store the login or email address in the variable.



This is mighty helpful since I used to have a snippet saved with an LDAP query to get display names.  Now it's all right there in one handy workflow action item!

April 03, 2012

All Workflows in Nintex 2007 broke!

I'm in the process of doing some trial upgrades from SharePoint 2007 to 2010 and the workflows in my 2007 environment started failing.  When a previously running workflow attempted to do something it'd error:
 @WorkflowData is not a parameter for procedure AddWorkflowProgress

Any attempts to restart workflow give the message:
 @WorkflowData is not a parameter for procedure CreateWorkflowInstance

I also noticed that in the 2007 environment the Database Version (Central Admin --> Nintex Workflow Management --> Database Setup) showed 2.0.1.4 instead of  1.something.  Turns out I forgot to change the server and database name in the Nintex Workflow database in the 2010 environment.  I quickly changed it in the 2010 environment and restarted IIS.

To fix the 2007 environment I opened up the Database Setup clicked Edit, verified the server and database then clicked OK.  It must have worked since my database version was back to 1.0.4.0 and when I started workflows they actually started instead of erroring.  I terminated errored workflows (including scheduled) and restarted the necessary ones.

Upgrading Nintex Workflow to 2010

I'm in the process of doing some test upgrades of SharePoint Service 3.0 to SharePoint Standard 2010.  Part of that features Nintex Workflow.  I'm following their 2007-2010 Upgrade Instructions using the Database Attach Upgrade method.  One part of the process is for changing the server and database name of the imported database.  I had to also include the instance name (should have been obvious) and restart IIS to get it to work.

I ran into the problem because my first round of testing was upgrading our test system which easily fit into the SQLExpress limit of 10 GB.  Our production system is more than 10 GB so I had to graduate to using the new production SQL Server for testing (though not actually in production yet).  As part of that process I there are certain roles that need to be on the server and I figured it'd be easiest if Nintex Workflow provisioned all of that rather than doing it manually.  I restored the production workflow database to the new server and when attempting to connect (Nintex Workflow Management --> Database Setup) to it I got this message in the browser: "Unexpected SQL error occurred.  Server name: servername Database name: database name. Correlation ID: [.....]".


Using ULS Viewer found on MSDN I was able to find out that it's basically a Named Pipes server can't be found (error 40)... but what's odd is it's the server and database of the current Nintex database (though without the instance ID), not the new location.

Resolution:
I pulled up the database table on the existing Nintex Workflow database and changed it to the current system\SQL Instance.  I rebooted the server (iisreset probably would have worked just as well) and was able to point the system to the new database on the production server.  Make sure the database table on the new server is correct before attempting to connect to it from Central Admin or your 2007 workflow environment will break.

March 19, 2012

Modifying Nintex Workflow Task Item "view"

Nintex Workflow overrides the "Edit" screen of a workflow, but doesn't change the "View" screen.  Here is how to change the "View" for Nintex Workflow tasks... such as hiding any unused fields like due date.
  1. Editing the workflow action item and note the Content type of the item you want to adjust ("ProjectNum" in screenshot below).
  2. Go to the Workflow Tasks List, open List Settings and modify the content type by hiding whatever fields you don't want visible.




 
 
If you want to change the Task Form Properties... that is you want to change the fields visible from the original list item on the "Edit" screen of a Workflow Task item... see this post.