Nintex Workflow + InfoPath Form

As most folk would be aware, the guts of an InfoPath form is simply (a lot of) XML.   There is a schema & a bunch of namespaces, but is essentially just XML.

So, if there are elements within the form that you want to retrieve – and do something like save to a database, or use to piece together an email, or some other business logic – then you might want to consider digging inside the XML.

YES – you can certainly have fields that are published out from the form, and will thus become meta data columns within the SharePoint list, but sometimes that’s not wanted (like I had recently).

Having a workflow around an InfoPath form will mean that you can have a bunch of logic & functionality in place, but sometimes you need a little bit more – and have to craft some custom code – eg. call a web service.

The scenario I faced recently required email notifications to include data from the form, BUT these fields are not available via any specific workflow or metadata variables – and some logic needed – eg. skip if “N/A” – or blank.

The solution I’d put in place covers the following :

  • Nintex workflow – passes the entire InfoPath form to a Web Service
  • Using standard .NET code, determine the elements from the XML (ie. InfoPath form)
  • Format the data values into a specific format (for an email in this case – but could be for anything)

 

C# XML Web Service

Starting with the web service is the best, as you won’t be able to add a “Web Service” call to the workflow otherwise – ie. if it doesn’t exist !

The web service will have ONE input variable, which is the binary representation of the form – ie. byte array.

The return value will be a ‘string’ – which I’ll format some text for the email notification.

  • Open Visual Studio, and create a new Web Service project
  • Add a new method (can replace the default one) – with something like this :

public string ProcessInfoPathForm(byte[] byteArray)

{

       return ‘”hello from Web Service”;

}

  • This initial web service method is enough to test out the ‘plumbing’.

Nintex Workflow

  • Can then include the web service call within the Nintex Workflow.
  • The value to pass to the Web Service method is “[FileData]”
  • filedata

Do Something

As the workflow has been assigned to the forms library itself, all instances of the workflow are ‘form-aware’.  There are workflow variables sourced from the metadata properties in the library – and the ‘entire’ form is available to get into the XML.

So, what’s needed within the web service method is :

  • Convert the byte[] to an XmlDocument
  • Use XPath queries to get the relevant data items
  • String together, update in a database, write to a log, whatever

Here’s some code to explain this premise :

//convert from byte() to memory stream
MemoryStream ms = new MemoryStream(byteArray);

//load into XML document – for xpath’ing
XmlDocument xDoc = new XmlDocument();
xDoc.Load(ms);

//need namespace manager
XmlNamespaceManager mgr = new XmlNamespaceManager(xDoc.NameTable);

//define the namespace – based on the URI within InfoPath

mgr.AddNamespace("my", schema-uri));

Now that it’s into an XML DOM object, we can use XPath to grab out values.

//determine the XML node for "my:fields"
XmlNode xNode = xDoc.SelectSingleNode("//my:myFields/my:PersonName", mgr);

if (xNode != null)
    personName = valueNode.InnerText;

That’s pretty much it – obviously there is additional XPATH methods needed for a ‘SelectNodes” – in which there’s a collection of items.   I’ve bundled a few such commands into a ‘shared’ or ‘common’ class library for use in projects such as this.

Has been kinda interesting to investigate & process the XML internals of an InfoPath form – via a Web Service – which has been called from a Nintex Workflow – phew !    

🙂

Advertisements

SharePoint deployment, admin, governance, etc

Great new white paper – reads as a list of “best practices” regarding SharePoint admin + deployment :

Administrator’s Guide of Topics to Consider before Deployment

This whitepaper guides administrators who are new to SharePoint products and technologies through key articles to consider before deploying SharePoint products and technologies in their environments.

Articles include server administration, governance, branding, and development.

Administrator’s Guide of Topics to Consider before Deployment

Contains some great descriptions, and lots of links to other TechNet articles.

Source : TechNet

Up the limit – SiteMapProvider

Was recently working with a client who had a SharePoint intranet site with a huuge list of pages in the left-hand nav “quick launch”.

They kept adding pages, and the new pages weren’t being listed (had to scroll dooown) – was showing 50, but no more.

Some searching turned up an article about the DynamicChildLimit property, which is part of the SiteMapProvider – used by the quick launch nav bar (as it’s source of data).

It turns out that there’s a default value, that is automatically set to 50, if you don’t include the parameter.

This is defined within the WEB.CONFIG – not the Master Page or Page Layout (where you’d find the quick launch menu, and so forth).

Instead, need to change the settings for the different types of Site Map Providers. WEB.CONFIG for the specific website – check via IIS, etc.

<add name=”GlobalNavSiteMapProvider” description=”CMS provider for Global navigation” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Global” EncodeOutput=”true” IncludePages=”PerWeb” IncludeHeadings=”true” IncludeAuthoredLinks=”true” DynamicChildLimit=”200″/>

If you specify that it’s “0”, there will be no limit – or set a specific value – ie. 200 (as above).

Remembering that this control (SiteMapProvider) may be used by other controls, and menus, etc – this change will affect all of those using the same SiteMapProvider.

There are a bunch of them listed in the WEB.CONFIG :

  • GlobalNavSiteMapProvider
  • CombinedNavSiteMapProvider
  • CurrentNavSiteMapProvider
  • CurrentNavSiteMapProviderNoEncode

Best to change this setting for “all” of them – you’ll probably have to include the property – as it’s not listed there by default.

Need to do an IISRESET – and the menu will show all pages (or up to 200, if that’s the value used, for example).

Thanks to SharePoint blogs for the tip.

Also – check out more info at MSDN.

SharePoint + Zune ?

Yep – using the DataView webpart within SharePoint, you can integrate external data, with (for example) information about your Zune music, and for friends also.
<blockquote>Woody Windischman shows us a very cool example of leveraging the SharePoint Data View to integrate external data.

In this case Woody integrates information from the Zune Social services as well as the Zune Marketplace. Very, very, cool stuff !!</blockquote>
<a href=”http://sharepoint.microsoft.com/blogs/mikeg/Lists/Posts/Post.aspx?ID=1414″>Video: SharePoint Zune Integration With Data View</a> (only 4.5 mins)

Solution Accelerators –> SharePoint

Available as additional “free bits” from Microsoft, Solution Accelerators are helpful toolkits and components for helping with implementing Microsoft Solutions.

TechNet > TechCenters > Microsoft Solution Accelerators

Much of these relate to the ‘server’ product line – such as Windows Server, SQL Server, Active Directory and so on.

Click to see an A-Z list of the Microsoft Solution Accelerators (TechNet)

There are a number of Solution Accelerators for SharePoint :

External Collaboration Toolkit for SharePoint (EXTRANET)

Every day, organizations collaborate on key projects with external business partners across the Internet.

These project teams regularly share important documents that might contain intellectual property or other information that should be kept secure.

Unfortunately, for many organizations the only option is to collaborate using e-mail, which can be both inefficient and is often not a secure method for collaboration.

The External Collaboration Toolkit for SharePoint is intended to help address this situation.

It consists of software and guidance that will help you to deploy a customizable solution built on Microsoft® Windows® SharePoint® Services 3.0 or Microsoft Office SharePoint Server 2007 that teams can use to collaborate securely with partners outside the firewall.

The toolkit’s familiar SharePoint interface makes the solution easy for project team members to understand and use.

SharePoint Capacity Planning Tool

Planning a Microsoft Windows SharePoint Services 3.0 (WSS) installation or a Microsoft Office SharePoint Server 2007 (MOSS) installation for a large enterprise can be a very complex undertaking.

Determining the most cost-effective topology, hardware, and bandwidth requirements is not a trivial task and involves selecting from a variety of configuration options. In choosing the option that best fits your organization’s needs, you need to answer the following questions:

  • What is the minimum hardware you need to deploy?
  • Where and how should you deploy the hardware?
  • How can you optimize your deployment to meet your organization’s requirements for availability and performance?
  • How will growing capacity needs affect the topology?

SharePoint Monitoring Toolkit

…contains two management packs for System Center Operations Manager 2007 that facilitate the management of SharePoint® environments of all sizes.

The management packs work with System Center Operations Manager 2007. They monitor the health state of the components in a SharePoint environment that affect performance and availability.

When there is an issue that may cause service or performance degradation, Operations Manager 2007 uses the management packs to detect the issue, alert system administrators to its existence, and facilitate diagnosis and corrective action.

Some great add-ons for SharePoint – worth checking out.

New SharePoint related bits

SharePoint Guidance – November 2008

This guidance helps architects and developers design, build, test, deploy, and upgrade SharePoint intranet applications.

A reference implementation (RI) demonstrates solutions to common architectural, development, and application lifecycle management challenges.

Microsoft SharePoint Services 3.0 Management Pack for Operations Manager 2007

This Management Pack monitors the health state of the components in your SharePoint environment that affect performance and availability.

When there is an issue that may cause service or performance degradation, Operations Manager 2007 uses the Management Pack to detect the issue, alert you to its existence, and facilitate diagnosis and corrective actions.

The management pack monitors:

  • Windows SharePoint Services 3.0 related services (Timer, Tracing and Search)
  • Windows SharePoint Services 3.0 related Events
  • Web server applications such as Internet Information Services (IIS)
  • IIS-related Events
  • Microsoft SQL Server® database-related events
  • WSS Server performance

SharePoint Online

Have heard that the SharePoint Online “in the cloud” offering (S+S) will be rolled out/available some time in early 2009.

Here’s a bit more about SharePoint Online :

Microsoft SharePoint Online provides a highly secure, central location where employees can efficiently collaborate with team members, find organizational resources, manage content and workflow, and gain the business insight to make better-informed decisions.

Based on Microsoft Office SharePoint Server 2007, this Microsoft-hosted solution helps employees create and manage custom team and project-focused intranet sites for collaboration and document sharing.

Users get the flexibility and customization they need to truly work efficiently across teams with tools like wikis, blogs, surveys, shared workspaces, and process workflows.

And as a seamless extension of the Microsoft Office system, SharePoint Online is familiar and easy to use, and it enables collaboration within the applications your users already know.

Microsoft SharePoint Online

There’s a document on the MSDN / Microsoft downloads site relating to Service Level Agreements (SLA) :

Microsoft SharePoint Online Service Level Agreement (SLA)

Will be interesting to see/hear more about this, as another offering for customers. 

Currently, we look to eMantra for SharePoint hosting – mainly with regard to Internet (publishing) sites.

Hosted Sharepoint WSS3.0 and MOSS 2007

Can work out to be about $500 per month – not bad when you consider the licensing aspects of SharePoint – and costs of the license for “Internet Connector”.  

Of course, you can’t deploy any custom code/webparts for this scenario – would be more likely to be $2,000 per month for a dedicated server.

Will have to wait and see the costings for the Microsoft hosted scenario.

Watch this space.

🙂

WSS Update – Daylight Savings (Time Zones)

Some new updates for SharePoint – or for Windows SharePoint Services (WSS) to be precise.  Related to Daylight Savings Times in some countries (KB956612) :

In many countries, the start dates and the end dates for daylight saving time (DST) change from year to year.

Additionally, countries may change their policies for recognizing daylight saving time, or they may change the local offset from Coordinated Universal Time (UTC).

This update includes updated time zone definitions for the following countries:

  • Iraq
  • Argentina
  • Chile
  • Iran
  • Morocco
  • Pakistan
  • Venezuela

Click here for more details – and download link :

MOSS, ISA, AAM, SSL

Without delving into the specific acronyms in the title, there is often much confusion when implementing SharePoint (MOSS) with a public face – ie. as an extranet or internet.

In many cases, there will be an ISA (Internet Security & Acceleration) Server which is used for a firewall, and/or VPN connectivity.

I’ll be up-front and honest and admit that I’m not so familiar with the inner workings of ISA and much of the configuration required for ISA – sounds like a bit of a black-art.

There is a dedicated team of infrastructure folk here at Dimension Data (thankfully) – who I can ask questions, or simply task the team with the config for a client.

For SharePoint, there are some configurations required to work with ISA – including the Alternative Access Mappings (AAM) allowing a user to navigate to a server – or, as Shakespeare might say – a server by another other name would small as sweet ?

Confused yet ?    OK – I am a little as well.

Throw some certificates and encryption into the mix (SSL) – and a cluster or farm of SharePoint Web Front Ends, and you can get tied up in knots – ending the day with a headache.

Found a great post from the Microsoft ISA Team Blog – covering some of the architecture and exploring one particular issue relating to MOSS and ISA :

Troubleshooting Sharepoint/MOSS 2007 publishing through ISA Server can be really challenging, mainly because most of the times the argument is “…but it works just fine internally”.

Unable to “Check Out” a Document in MOSS 2007 Published Through ISA Server 2006

There is also a great introductory article (TechNet) about some of the planning and considerations required for an ISA implementation – and the mysterious AAM scenario :

Alternate access mappings enable Office SharePoint Server 2007 to map Web requests to the correct Web applications and sites, and they enable Office SharePoint Server 2007 to serve the correct content back to the user.

Plan alternate access mappings (Office SharePoint Server)

Some good material – and well worth a read-through when planning/implementing an externally facing SharePoint setup.

SharePoint at the Microsoft PDC 2008

Even MORE reasons to be jealous of those who are attending PDC – here’s a few of the sessions to be held (according to Paul Andrew, who SHOULD know !) :

  • SharePoint 2007: Creating SharePoint Applications with Visual Studio 2008

building a SharePoint site from scratch in Visual Studio 2008 using the Visual Studio 2008 extensions for SharePoint.

He will be adding branding to the site and the site will feature a list, event receivers, a wiki and a Silverlight web part.

The Silverlight web part will include something new that is being announced at the PDC in a prior talk.

  • SharePoint Online: Extending Your Service

…various options for programming against SharePoint Online. You can’t upload binary code to the SharePoint Online servers but there are many ways you can still extend this.

This talk will explain these extensibility mechanisms and show them coded against SharePoint Online.

This will include use of the SharePoint Online Web Services, customizing SharePoint online with SharePoint Designer, calling out from the Data View Web Part to web services, building Silverlight controls with .NET code that run on SharePoint Online.

  • SharePoint 2007: Advanced Asynchronous Workflow Messaging

Learn how to build an employee on-boarding application that depends on a server located inside another company.

We show how to use Microsoft Visual Studio to build the document workflow and have it asynchronously message a business service hosted behind another company’s firewall.

  • FAST: Building Search-Driven Portals with Microsoft Office SharePoint Server 2007 and Microsoft Silverlight

The combination of FAST ESP and Microsoft Office SharePoint Server (MOSS) 2007 allows for the development of powerful search-driven portals. Learn about the architecture and functionality of FAST ESP, and see how FAST ESP can complement and extend existing search features in MOSS 2007. Watch a demonstration that shows how to create search user interfaces by configuring and extending the FAST ESP Search Web Parts, including the use of Silverlight to deliver unique search experiences.

And – if you ARE attending – take a look at the 160GB portable drive which will be given to all attendees :

The PDC 2008 Hard Drives will have a SharePoint VPC containing 10 SharePoint Developer Hands on Labs.

Click here to read more.