Brian Loesgen's Blog

BizTalk, Enterprise Service Bus (ESB), SOA, Oslo, San Diego .NET User Group, San Diego Software Industry Council Web Services... and stuff!

  Home  |   Contact  |   Syndication    |   Login
  105 Posts | 0 Stories | 77 Comments | 84 Trackbacks

News

Tag Cloud


Archives

Post Categories

Image Galleries

My Blog Friends

… to start thinking like a SharePoint person.

I see paradigm misalignments all the time, where really bright people develop BizTalk solutions using object-oriented principles, just as they would if they were developing say a typical .NET application. However, as BizTalk is a message-oriented paradigm, thinking like an OO person will generally yield less agile, less scalable, and unnecessarily complex solutions.

In my case, I was crossing the BizTalk/SharePoint boundary, but my initial direction didn’t reflect that transition.

I was working on an order process, and we needed to involve humans in case there was something wrong with the order and intervention was required, a typical repair-and-resubmit pattern. To interact with humans, we used a combination of SharePoint (as a host) and InfoPath (as an editing environment). The idea was BizTalk writes out orders requiring intervention to a forms library, users click a link there, and edit the order in InfoPath. When ready, the user clicks “re-submit” and the order is re-processed. Implementing this is no big deal, and as InfoPath works well with Web services, a Web service call sits behind the “re-submit” button. The next step is that we now need to delete the item from the forms library. OK, thinking like a SOA/Web services person, I thought I’d do that by calling the SharePoint Web service. However, after some investigation, it turned out that this was actually two Web service calls, one to get the item ID (which is required in order to delete the item) and another to do the actual deletion.

This path now meant that when the user presses “re-submit”, three Web service calls occur. This immediately raised the following concerns:

·         User experience: how much time will pass from the time the user presses the button until the action is complete?

·         Latency: the client network is sometimes slow, if there are three calls, we have three chances to time-out

·         Transactional integrity: we need to think about cases such as the order is resubmitted, but the deletion from SharePoint doesn’t occur (timeout, network failure, server down, etc). Now there’s a risk of duplicate orders

Clearly, although the solution met the functional requirements, this seemed like a sub-optimal approach that was *fraught* with risk.

I started exploring ways to optimize the actions behind the button. It was a call with one of Neudesic’s SharePoint experts that turned on a light for me. Apparently, “the SharePoint way” would be to save out the form, then let something else happen. Why couldn’t I do the same?

So, the revised solution is:

·         BizTalk writes out an order (XML document) to a SharePoint forms library

·         There is an “OrderStatus” SharePoint meta-data column, when first written out, this is set to “INTERVENTION”

·         User opens a “Orders for Review” SharePoint view (which only shows items that have an order status of “INTERVENTION”)

·         User edits order in InfoPath. When done they hit “re-submit”

·         Behind the button, the order status is changed to “RESUBMIT”, and the form is saved back to the same form library

·         A BizTalk receive location is polling the form library using a second SharePoint view (“Orders to be processed”)  that only shows forms with a status of “RESUBMIT”

This now means:

·         Perceived latency after pressing the re-submit button dropped from “could be 20 or 30 seconds, if everything works” to “sub-second response”

·         Everything is asynchronous and loosely-coupled now, resilient to outages or failures

·         The revised approach leverages the environment it is running in (message-oriented inside BizTalk, document-centric inside SharePoint)

·         The InfoPath form becomes extremely simple

·         I have actually managed to use the word “fraught” in a blog post J

And, as an added bonus…. We will have different form libraries, as order editing will be done by the people in a region. With this approach, deployment becomes simpler as we’ll be changing endpoints in BizTalk and adding views in SharePoint, as opposed to coming up with a strategy to manage endpoints used in code-behind an InfoPath form.

As we move further into a services-oriented world where creating solutions increasingly means tying services and applications together, it is important for us to remember that there are environment boundaries, and sometimes those are also paradigm boundaries. If a solution you’re working on seems like it’s overly complex, then perhaps you’ve crossed an environment boundary but brought your paradigm with you. Step back, take a deep breath, and re-evaluate your approach from a high level.

This may be obvious to many, but I thought I’d blog about this real-world experience for the benefit of SOA/Web service people that would, because it would be perfectly natural for them,  end up going down the “do all the calls behind the button” path.

 

 

posted on Sunday, June 24, 2007 7:45 AM

Feedback

# re: When BizTalk meets SharePoint, it makes sense… 6/24/2007 12:58 PM McGeeky
Excellent post, thanks. Another benefit of your loose coupling model is testing; when apps are tightly coupled it is very difficult, if not impossible, to separate out the parts and test them in isolation.

# re: When BizTalk meets SharePoint, it makes sense… 10/18/2007 7:02 PM Ahmed Farrag [Biztalk MVP]
Great Post , loved the approach, keep it up SOA :)

# Solution extension for full life-cycle of an order 2/3/2008 6:26 AM Krzysztof K. Zdeb
Hello,

I like your post very much. However it describes only a half of a soultion in my case. I'd like to discuss how to extend it.

The aim is to allow users to monitor processing of an order (the order should be always accessible in forms library). So after last of your action points (in revised solution of course) I would add something like this:
- BizTalk writes an order back in the forms library with OrderStatus=PROCESSING
- BizTalk processes the order (in my case processing of an order takes up to few minutes)
- BizTalk overwrites an order with status changed to DONE.

Remark: InfoPath template for an order would lock orders with PROCESSING status from edition.

Questions:
1) What do you think about this approach? Would you change anything?
2) I assume that both polling and writing orders by BizTalk to/from forms library are done using SharePoint Adapter. Right?
3) Does BizTalk's SharePoint Adapter allow to overwrite a form (last step), or maybe I have to do it in two steps (poll order with PROCESSING status, and write back the one with DONE status)?

# re: When BizTalk meets SharePoint, it makes sense… 2/3/2008 6:44 AM Brian Loesgen
Krzysztof:

1) We used a very similar approach on a proof-oc-concept project I was on last year, where the "order" had to always be visible in SharePoint. So yes, it's a perfectly valid pattern.

2) Correct. Ideally, the SharePoint adapter is querying views, the same views that you make available to humans

3) yes, you can overwrite, see http://msdn2.microsoft.com/en-us/library/aa547920.aspx


# re: When BizTalk meets SharePoint, it makes sense… 2/12/2008 5:56 AM Mike
We are working on a similar solution for routing BizTalk errors to a SharePoint Forms Library. We are running into issues with writing to the Forms library.

We are getting errors because we cannot point to the appropriate template since the Forms Library doesn't have a xsn file readily available. The template associated to the Forms Library does not exist in a directory structure I can find. How did you accomplish that part of this configuration?

We were able to get this working with a Document Library, but found linking the form values to the SharePoint Document Library was not easily possible. What is different with setting up the Adapter to write to a Forms Library as opposed to a Document Library.

Thanks,

Mike

# re: When BizTalk meets SharePoint, it makes sense… 6/11/2008 11:33 PM Geoff_C
The InfoPath / Sharepoint stuff is new to me. Can someone point me to something that will tell me how to change the metadata status column from the form as described in the original post|? Thanks.

# re: When BizTalk meets SharePoint, it makes sense… 6/16/2008 1:43 AM Chris Beckett
InfoPath fields can become SharePoint columns when published to SharePoint. Probably the easiest way (the way I would do it :) would be have the status column as a *promoted* property in InfoPath published to the SharePoint form library. A new InfoPath/SharePoint 2007 feature allows you to configure a promoted column so it can be updated without having to open the InfoPath form, so the status column can easily be changed from SharePoint.

# re: When BizTalk meets SharePoint, it makes sense… 6/16/2008 2:35 AM Geoff_C
Can I do it the other way round as above - "Behind the button, the order status is changed to “RESUBMIT”, and the form is saved back to the same form library". I would like to do the same thing from a button but I'm not sure where to start!


# re: When BizTalk meets SharePoint, it makes sense… 6/16/2008 5:56 AM Chris Beckett
The *button* in InfoPath would be a submit button that saves the InfoPath form back to the same form library. If you have a status field in InfoPath (even if it is hidden from the user), then saving the form will update the status.

Here would be the actions to take:

- configure the InfoPath form to have a status field (even if hidden from the user) in the main data source

- configure the form to promote the status field as a column in the form library (make sure to check that the field is updateable just in case you want to change it from somewhere else)

- configure the form submit action to save the form to the target form library

- drop a button on the form and edit the rules for the button to a) change the hidden status field, b) submit the form

All of this can be accomplished with no code.

Hope this helps,
Chris

# re: When BizTalk meets SharePoint, it makes sense… 6/17/2008 3:10 AM Geoff_C
Thanks. I think the confusion is that I am using InfoPath 2003 and this seems to lack the functionaloity required. I'll have to upograde 2007.

Thanks again for your help. Much appreciated.

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 2 and 5 and type the answer here: