The Visual Studio Post Deployment Script For Nintex Workflows & Forms

Application Lifecycle Management (ALM) has always been a problem for those who create SharePoint Solutions and need to include the Nintex Workflows & Forms within their final packages. The traditional way of doing it was deploying WSPs and then moving the different Workflows & Forms by exporting them from the Dev environments and importing them to the target ones (Testing, Staging, UAT, Prod, etc…). I’ve also seen some developers using the SDK to create features that take care of deploying & publishing the different Nintex artifacts.

pastedimage_11

I’ve explained how to automate the full process (like the above figure” along with the way to apply the Continuous Integration & Continuous Deployment concepts during my InspireX session “Application Lifecycle Management for Nintex Solutions” and right after the session, I received a lot of requests to start sharing the scripts.

This post is the first of a series and is going to deal with the first step towards Application Lifecycle Management for Nintex which is setting up your development environment. The goal of the post is to provide you with a way to manage your Nintex assets in Team Foundation Server so that any developer in the team can get the latest work from Team Foundation Server, click deploy and BOOOM, all the SharePoint & Nintex artifacts get deployed and published.

Here are the steps:

1) Download the scripts from Nintex Connect. I’ve also added the SharePoint Project so you can quickly test the whole thing.

2) In the Visual Studio SharePoint Project, create a new folder and name it “NintexArtifacts“.

pastedimage_0

3) Create a subfolder in the “Nintex Artifacts” folder for each list where you would like to publish the Workflows & Forms. Make sure to name the subfolders after the list instances.

pastedimage_1

4) In the Post-deployment Command Line, call the VisualStudioPostDeploymentScriptForNintex.ps1 . The script expects two parameters:

– Project Folder Location (projectFolderLocation)

– Site Collection URL (devSiteColUrl)

Here is what you should add in Visual Studio:

%windir%\sysnative\windowspowershell\v1.0\powershell -file “C:\DevScripts\Scripts\VisualStudioPostDeploymentScriptForNintex.ps1” -projectFolderLocation “$(ProjectDir)”” -devSiteColUrl “$(SharePointSiteUrl)”

pastedimage_2

If you’re wondering why we are using “%windir%\sysnative\windowspowershell\v1.0\powershell” rather than directly calling the script, it’s due to the fact that SharePoint is 64bit and Visual Studio is still 32bit. This means that Visual Studio will by default call the 32bit version of PowerShell resulting in errors. That’s why we, instead, need to instruct Visual Studio to load the 64bit PowerShell by referencing “%windir%\sysnative\windowspowershell\v1.0\powershell”.

5) Once you click “Deploy”, here is what you should see in the Output Windows:

pastedimage_3

6) Once deployment is done, open your list and check whether the Workflows & Forms have been successfully published!!

Give it a shot and let me know if you have any questions!

Advertisements