Skip navigation
All Places > Getting Started > Blog > 2016 > February
2016

Know your process

"Know your process”, this seems like a simple, straightforward statement, but I found that many users just do not know it as well as they should. I wanted to share my thoughts, findings, and approaches on how I tackle this within my own company and hope to hear about how you, as a workflow developer or form guru, approach your customers.

 

Initial idea

We all have been in those meetings where someone says "this would be a good candidate for a SharePoint workflow and/or form", and dread the next steps (or you get giddy and excited over a new chance to prove your skills...I geek out way too much!). The flood of a million questions starts to pour in: Why SharePoint? Are we replacing something existing? Is the current process broken? Who owns this? And so on. For me, I take this time to gather my own information. I pour over the current process as an end user and see what the experience is TODAY, and take notes on its strengths and weaknesses. With this in hand, I can hold an intelligent conversation with the process owner as well as the stakeholder.

 

Requirements Gathering

There are a lot of different approaches on this so I am going to stick to what I know and what works best for me. I will meet with the process owner; the one that uses the form the most or manages the process. This way I am really getting the most out of what NEEDS to happen rather than what people WANT to happen. Here is where I see what the process does behind the scenes and begin to understand how we can translate it into SharePoint and Nintex. This is also when we see just how much of the process is unknown, undocumented, or (my favorite) "well that is just how we have always done it". At this point it can go one of two ways; start developing a solution because the process is detailed out and you have a clear understanding of what needs to happen (I am beginning to think this actually doesn't happen...) or we go back to the owner and help them detail out their process.

 

Detailing out the process

Let’s say that for some crazy reason your process is not detailed out (pretend if you have to). What I like to do is get the process owner involved. They can tell me what happens for each step at a high level. I have even started to ask owners to create a simple Visio diagram of the workflow so that way they can visualize it, but if I cannot get that piece, I generally white-board it out. This also lends a hand to the owner so they can see just how the process works and see if they are missing or overlooking something because it has been ingrained in them over the years. I try to ask questions along the way and challenge the process where I can; do we need to email them multiple times or can we do it once at the end? Do we need to do multiple web service calls or can we consolidate down? Sometimes we find new ways; sometimes we learn that it HAS to be a certain way due to security. Either way, it gets both sides involved and understanding the process inside and out. It helps to show all of the expected outcomes and what items are needed along the way. Once I have this, I have a blueprint for what I need to develop.

 

Developing a solution

For me, I spin up a site in our test environment and start building. This gives my customer a tailored site that is just for them and it keeps everything else clean; I know what I am testing and where the tests are located. Once I have a stable version of the process, I open it up to the customer and say "have at it!” I force them to meet with me, face-to-face, and review what they like, dislike, want, don't want. The reason I do face-to-face is that emails get lost, glazed over, and generally ignored. This forces the customers to engage with me and take a look at what is going on. It also allows them to have a voice and feel as if they are building it too. I ask the customer for when they want to start using it and try to manage expectations from there. We all know that this is not one and done, but a reiterative in nature. Meaning that it takes time to develop, a lot of back and forth, but we can provide working solutions and with customer feedback we can refine the process as it evolves.

 

Going back

All too often we deliver a process to a customer and a few weeks later they reach out and have changes. This is because they did not account for something or the user experience is not exactly how they envisioned it. This is generally not a big deal since we can update workflows without taking outages. We can update forms without major interruptions. We can add new logic to lists without anyone noticing. Even if your process is "set it and forget it", I do encourage you to go back and take a look at it again and ask yourself is there a better way? I find myself learning new things from this community every day and am blown away how much knowledge and passion there is out there for Nintex.

 

Please let me know your story and what tips or tricks you use to translate the needs and wants into working Nintex solutions.

 

Until next time!

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

There is often the need to pull SharePoint ULS logs and share them with another team. Going and manually pulling the logs is often cumbersome and time consuming. This script helps with this by providing a way of pulling the logs, zipping them and uploading them to a SharePoint Document Library.

 

TIP: This script works very well with the PowerShell action for Nintex Workflow 2013

 

PowerShell Script
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell
  2. [System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem')
  3. $file = "logname"
  4. $basePath = "C:\Logs"
  5. $path = $($basePath + "\" + $file)
  6. $zipPath = $($basePath + "\" + $file + ".zip")
  7. $startTime = "01/01/1999 00:00"
  8. $endTime = "01/01/1999 01:00"
  9. $logLibraryName = 'ULS_Logs'
  10. New-Item $path -ItemType directory
  11. Merge-SPLogFile -Path $($path + "\" + "SPLogFile.log") -Overwrite -StartTime $startTime -EndTime $endTime
  12. [System.IO.Compression.Zipfile]::CreateFromDirectory($path, $zipPath)
  13. Remove-Item -Path $path -Recurse
  14. $target = $(Get-SPWeb -Identity http://contoso.com).GetFolder($logLibraryName)
  15. $stream = $(Get-Item $zipPath).OpenRead()
  16. $target.Files.Add($($target.Url + "/") + $($file + ".zip"), $stream, $true)
  17. $stream.Close()

To use the script do the following:

  • Ensure you are running the PowerShell console as a SharePoint Administrative account.
  • Configure the URL of the site the ULS logs will be uploaded to (line 26).
  • Configure the StartTime and EndTime of the collection window (lines 12 and 14).
  • Configure the staging path where the log files will be kept prior to uploading (line 6).
  • Configure the destination Document Library for the ULS logs (line 16).

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

This PowerShell script will do the following:

 

  • Create a new SharePoint Content Database
  • Create a new SharePoint Site Collection and assign it to the newly created SharePoint Content Database
  • Set the SharePoint Content Database to not allow any new Site Collections to be associated with it
  • Provision a new Nintex Content Database
  • Create a 1-to-1 Mapping with the SharePoint Content Database and the Nintex Content Database
  • Activate Nintex Workflow and Forms Site Collection Features
  • Activate Nintex Workflow SubSite Features

 

PowerShell Script
  1. #Load assemblies
  2. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  3. $assemblies = "Nintex.Workflow.Administration", "System.Data.SqlClient.SqlConnectionStringBuilder"
  4. foreach($assembly in $assemblies)
  5. {
  6.     [void][System.Reflection.Assembly]::LoadWithPartialName($assembly)
  7. }
  8. #Set variables
  9. $hostname = "http://contoso.com" #Set web application hostname
  10. $sitename = "teamsite" #Set site name
  11. $managedpath = "sites" #Set managed path
  12. $siteurl = "$($hostname)/$($managedpath)/$($sitename)"
  13. $siteTemplate = $(Get-SPWebTemplate | WHERE {$_.Title -eq 'Team Site' -and $_.CompatibilityLevel -eq 15}) #Set to Teamsite by default
  14. $owner = "siteowner" #Set siteowner
  15. $databasename = "SPContentDB_$(sitename)" #Set SharePoint content database name
  16. $databaseserver = "SERVER\SHAREPOINT" #Set SQL database server
  17. $NintexDBName = "NW2013DB_$($sitename)" #Set Nintex content database name
  18. $connectionstring = "Server=$($databaseserver); Database=$($NintexDBName); Integrated Security = true;"
  19. #Provision site collection and SharePoint content database.
  20. New-SPContentDatabase -Name $databasename -DatabaseServer $databaseserver -WebApplication $hostname
  21. New-SPSite -URL $siteurl  -OwnerAlias $owner -ContentDatabase $databasename -Template $siteTemplate
  22. Get-SPContentDatabase -Site $siteurl | Set-SPContentDatabase -MaxSiteCount 1 -WarningSiteCount 0
  23. #Provision Nintex content database
  24. $dbattacher = New-Object -TypeName Nintex.Workflow.Administration.DatabaseAttacher -ArgumentList @($connectionstring,[Nintex.Workflow.Administration.DatabaseAttachValidationMode]::PerformValidation)
  25. $dbattacher.AttachOptions.ProvideAllWebApplicationsAccess = $true
  26. $dbattacher.AttachOptions.CreateNewDatabase = $true
  27. $dbattacher.AttachOptions.IncludeStorageRecordStep = $true
  28. $result = $dbattacher.Attach()
  29. $configdb = [Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase()
  30. #Create 1-to-1 mapping
  31. $newcontentdb = $configdb.ContentDatabases.FindByDatabaseAndServerName($databaseserver, $NintexDBName)
  32. $newdbmapping = New-Object -TypeName Nintex.Workflow.ContentDbMapping
  33. $newdbmapping.SPContentDbId = $(Get-SPDatabase | Where {$_.Name -eq $databasename}).Id
  34. $newdbmapping.NWContentDbId = $newcontentdb.DatabaseId
  35. $newdbmapping.CreateOrUpdate()
  36. #Activate Site Collection Features
  37. foreach($id in @('eb657559-be37-4b91-a369-1c201183c779', '0561d315-d5db-4736-929e-26da142812c5', '716f0ee9-e2b0-41f0-a73c-47ed73f135de','202afc3c-7384-4700-978d-6da3d3cce192', 'ac8addc7-7252-4136-8dcb-9887a277ae2c', '53164b55-e60f-4bed-b582-a87da32b92f1', '23fce797-ac15-4451-b8da-cf8ac6de6912', '54668547-c03f-4bb5-aaab-d9568ebaf9c9', '80bf3218-7353-11df-af9f-058bdfd72085'))
  38. {
  39. $(Get-SPFeature -Identity $id) | Enable-SPFeature -Url $siteurl
  40. }
  41. #Activate Subsite Features
  42. foreach($id in @('9bf7bf98-5660-498a-9399-bc656a61ed5d', '2fb9d5df-2fb5-403d-b155-535c256be1dc'))
  43. {
  44. $(Get-SPFeature -Identity $id) | Enable-SPFeature -Url $siteurl
  45. }

To use the script do the following:

  • Ensure you are running the PowerShell console as a SharePoint Administrative account.
  • Configure the variables in the script to the application.

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

WARNING: THIS SHOULD NEVER BE USED IN A PRODUCTION ENVIRONMENT

 

When working on a workflow in a development environment it is often desirable to run through many instances of a workflow under various conditions. If the workflow utilizes pauses, this can be quite cumbersome when testing. This PowerShell script can be run on a development server to force the Workflow Timer job to run at a specified interval with no minimum (Example: 5 seconds) making testing a lot faster.

 

Since this script does not actually modify anything, it makes it easy to turn it off and on during your testing cycles.

 

PowerShell Script
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2. $job = $(Get-SPTimerJob -Identity 'job-workflow')
  3. while($true)
  4. {
  5.     $job.RunNow()
  6.     Start-Sleep(10)
  7. }

To use the script do the following:

  • Ensure you are running the PowerShell console as a SharePoint Administrative account.
  • Configure the value in "Start-Sleep" to the interval the workflow timer job should run at.

When you get the value of a person via Nintex Workflows, you often get a bit of a messy string back – it starts with “i:0#.f|” and may also be “i:0#.f|membership|” . That string is the claims token. Here’s how to get rid of it using the Regular Expression action on Office 365.

 

2016-01-28_16-48-57.jpg

Read more: http://sharepoint.hannahswain.eu/2016/01/28/remove-claims-token-with-regular-expressions-and-nintex-on-office-365/

It's common have a main item or document with associated tasks when working with a workflow. If you need a link from the task form to the main item form, perhaps to update the main item, here's how to do it.  This was tested on Office 365.

2016-02-04_16-16-19.jpg

Read more: Add button on Nintex task form to edit main item with JavaScript - Hannah's SharePoint

Filter Blog

By date: By tag: