<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Wire</title>
	<atom:link href="http://www.wirebear.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wirebear.com/blog</link>
	<description>Making Smartphones Smarter</description>
	<lastBuildDate>Tue, 16 Aug 2011 13:49:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>App Stores StackExchange</title>
		<link>http://www.wirebear.com/blog/2011/08/16/app-stores-stackexchange/</link>
		<comments>http://www.wirebear.com/blog/2011/08/16/app-stores-stackexchange/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 13:49:50 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[StackExchange]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[Area51]]></category>
		<category><![CDATA[Marketplace]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=726</guid>
		<description><![CDATA[I am a big fan of the StackExchange model of questions and answers. I participate on multiple sites (see my badge on the right). If you are still using traditional forums to try and get answers to your questions, you're really missing out. I am a developer so I use StackOverflow all the time, but [...]]]></description>
			<content:encoded><![CDATA[<p>I am a big fan of the <a href="http://stackexchange.com/" target="_blank">StackExchange</a> model of questions and answers. I participate on <a href="http://stackexchange.com/users/e26f6fb0-226f-4794-9767-edcaea31607f" target="_blank">multiple sites</a> (see my badge on the right). If you are still using traditional forums to try and get answers to your questions, you're really missing out. I am a developer so I use <a href="http://stackoverflow.com/" target="_blank">StackOverflow</a> all the time, but there are plenty of <a href="http://stackexchange.com/sites">sites</a> related to all sorts of topics.</p>
<p>One of the really nice things about StackExchange is their willingness to develop communities based around nearly any topic. There's a process of following, definition, and commitment required to get any new community up and running to ensure it isn't just another dead site. This is all done on <a href="http://area51.stackexchange.com/" target="_blank">Area51</a> the StackExchange staging zone.</p>
<p>One of the new proposals I am pretty excited about is the <a href="http://area51.stackexchange.com/proposals/30702/app-stores?referrer=fGCpfsmG3P9SPTdluUKgFA2" target="_blank">App Stores</a> site. It aims to fill in the gap with questions related to App Store deployment (Apple, Android, WP7, etc.) that aren't directly related to programming (<a href="http://stackoverflow.com/" target="_blank">StackOverflow</a>) or design (<a href="http://ux.stackexchange.com/" target="_blank">User Experience</a>).  From the proposal:</p>
<blockquote><p>Proposed Q&amp;A site for developers who have questions about the technical and business aspects of submitting apps to App Stores and Markets. (Typically for mobile, but not exclusively limited to.)</p></blockquote>
<p>There are a lot of things to learn when it comes to app development - regardless of platform. Once you've designed, created, and tested your app it can seem like you should basically be done. Unfortunately, the last few steps of actually distributing your app(s) can be quite challenging - especially the first time.</p>
<p>There can be huge delays as you try and sort through the layers of policies and requirements. Trying to use outdated advice from Google is extremely frustrating and it can be pretty stressful trying to figure out the dynamics of an App Store when all you want to do is get your app out there.</p>
<p>I wish this site had been around the first times we submitted to the Apple App Store, Android Marketplace, Amazon Appstore and the WP7 Marketplace. Each had it's quirks and surprises. If you've had experience submitting to or working with any app store, consider following and then committing to this proposal. Let's take the lessons we've learned and share them. It's a great idea and will be a fantastic resource - so check it out!</p>
<p><a href="http://area51.stackexchange.com/proposals/30702/app-stores?referrer=fGCpfsmG3P9SPTdluUKgFA2"><img class="aligncenter" src="http://area51.stackexchange.com/ads/proposal/30702.png" alt="Stack Exchange Q&amp;A site proposal: App Stores" width="220" height="250" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/08/16/app-stores-stackexchange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pricing Your App (and is WP7 worth it?)</title>
		<link>http://www.wirebear.com/blog/2011/06/02/pricing-your-app-and-is-wp7-worth-it/</link>
		<comments>http://www.wirebear.com/blog/2011/06/02/pricing-your-app-and-is-wp7-worth-it/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 12:00:46 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Smartphones]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Marketplace]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[Panda!]]></category>
		<category><![CDATA[pricing]]></category>
		<category><![CDATA[THE DOG]]></category>
		<category><![CDATA[windows phone]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=702</guid>
		<description><![CDATA[Setting your app's price can be overwhelmingly complex but may not be the most important question when it comes to the business strategy of your mobile development business. We also briefly compare WP7 and iOS market success.]]></description>
			<content:encoded><![CDATA[<p>Setting the price of any product can be difficult. You have to balance the costs (development, licensing, maintenance, promotion, etc.) with what is fair to charge for your product, what the market will bear, competition, etc. Apps are no different. Unfortunately, there also isn't a lot of publicly available information on actual sales, historical trends, or successful strategies.  Add to that that apps are a lot harder to compare to each other (in contrast to something like office furniture), and you end up with a lot of guessing, experimentation, and frustration.</p>
<p style="text-align: center;"><a href="http://dilbert.com/strips/comic/2011-02-12/"><img class="aligncenter" title="Dilbert.com" src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/100000/10000/2000/300/112316/112316.strip.gif" alt="Dilbert.com" width="512" height="159" /></a></p>
<p>One of the interesting things about the above Dilbert comic is that it contradicts the marketing campaigns of Apple, Google and Microsoft that imply anyone with a free weekend, some mild development talent, and a magical idea is practically guaranteed a million dollars. Can you make money developing apps? <em>Absolutely.</em> However, many starting developers and their mothers may be surprised to learn that there is a lot more to it than just making something that works.</p>
<p>I couldn't tell you the number of times people have found out that I am part of an app development company with multiple apps on multiple platforms and been amazed that I'm not making millions of dollars every month with all that sweet app money. After that there's usually a moment of awkwardness where they are trying to figure out how I screwed up something so obviously "easy".</p>
<p>It just isn't that simple. There's a lot that goes into a "successful" app that has nothing to do with traditional development. One of those things, is your app's price. You need great screenshots, marketing, luck, well written descriptions, reviews, more luck, etc., but if a customer isn't willing to pay whatever you're asking then, too bad. It's not my goal to discourage new developers/companies or to provide exact guidance on how to price your individual app. There are plenty of articles out there all about the "right formula" but I've not found them too helpful. What has been helpful are the few articles that give insight into specific experiences. I won't be giving out exact numbers due to licensing restrictions, but I still wanted to talk a little about our experiences with one of our apps, <strong>THE DOG</strong>.</p>
<p><strong>THE DOG</strong> is a breed guide app featuring <a href="http://www.thedog-clubs.com" target="_blank">Artlist's</a> beautiful and unique photographs of dogs and made in conjunction with <a href="http://4kidsentertainment.com/" target="_blank">4Kids Entertainment</a>. It is currently available for <a href="http://itunes.apple.com/us/app/the-dog/id401777147?mt=" target="_blank">iOS</a> and <a href="http://social.zune.net/redirect?type=phoneApp&amp;id=adbd08bd-4b6f-e011-81d2-78e7d1fa76f8" target="_blank">WP7</a> and the Android version will be available in the next couple of weeks.</p>
<p>We did some experimentation on the App Store (Apple) by setting our apps at a series of price points and comparing the number of downloads. Our guess was that at the higher prices we would have fewer downloads but higher overall profit. However, we found that the number of downloads was so much higher at $.99 that the profit was greater for that price point than any other.</p>
<p>We feel <strong>THE DOG</strong> is a quality app and well worth at least $4.99 considering that's a one time fee that includes lifetime updates, no ads, hundreds of photos, tons of information and more. We had some customers that agreed with us and purchased at that price and at the various prices between that and $.99 (Thank you!). However, <em>even at $1.99 the number of downloads was less than half of what they were when we switched to $.99</em>. Then considering that higher numbers of downloads leads to higher rankings within the store and therefore higher numbers of downloads and higher rankings... and so on, and it was a pretty easy choice for us to change the pricing.</p>
<p>I recently read this article, <a href="http://www.tgdaily.com/mobility-brief/56224-microsoft-wants-expensive-apps-on-windows-phone" target="_blank">Microsoft Wants Expensive Apps on Windows Phone</a>, and was a little conflicted. As a consumer of apps myself, I really enjoy the amazing low prices of some really cool software. But as a developer, I understand that the push from consumers for higher quality apps with more and more features, lifetime updates, beautiful graphics, and full social media integration all for $.99 or in many cases free - seems unsustainable (or at least unprofitable) using traditional development methodologies.</p>
<p>Overall, I like Microsoft's idea of increasing app prices (along with quality, integration, etc.) and am excited about the new opportunities with the upcoming Mango release, but the App Store has already set the trend that only truly exceptional or niche apps should be priced higher than $.99 if you are to have any sales.  Perhaps while the Marketplace is still relatively small (currently 20,000 apps), higher price points will be possible.  But with an influx of apps (competition) those price points are bound to drop.</p>
<p>Part of the problem for us developers is that none of the app platform companies are totally partnering with us.  They are providing amazing platforms, great tools (for free in nearly every case), ongoing support, community interaction and more. But they are also taking 30% of all sales and $99 a year from developers, effectively making us their customers/employees.</p>
<p>This means they have to balance enabling our success (after all they make the most money when we do) with keeping up an image of huge opportunity for little investment to keep us all coding. This sometimes leads to misleading or generic statistics that can often lead to disappointment for the vast number of developers (even some really good ones). It's hard to know what to include, when to release, and how much to invest - let alone how much to charge.</p>
<p>Going back to <strong>THE DOG</strong>, we decided to port the app to WP7 to try and get in early while the competition was still low. Android and iOS have many dog apps, and while we are confident that our app is as good and in most cases better than those apps, it can be easy to get lost in a sea of apps that all make similar claims. In addition, C# and the development environment (Visual Studio) for Windows Phone was already very familiar to us and made getting started very quick and easy. Porting the app required a complete rewrite from the iOS version but was still considerably easier than starting from scratch. This made the required investment relatively small and a worthwhile experiment.</p>
<p>We assumed that since the competition was so low, app sales would be as good or better than the iOS version. The iOS version is doing very well, unfortunately, as of right now the WP7 version is not(?). Actually, it's hard to tell if our app is doing well (at least relatively) without base line numbers to compare it to. But from our perspective of the amount of sales needed to justify the costs (let alone show a profit), it isn't cutting it.</p>
<p>I would suspect this has less to do with our app, and more to do with the size of the market. For now, the number of potential customers is just so much smaller for Windows Phone.</p>
<p>There are other things we can do and may try in the next couple of weeks (Trial mode, offer a free version, extensive marketing, etc.), but we are seeing similar results for another ported product - <strong>Panda! </strong>(<a href="http://itunes.apple.com/us/app/panda/id363661061?mt=8&amp;ls=1" target="_blank">iOS</a>, <a href=" http://social.zune.net/redirect?type=phoneApp&amp;id=8f2ab1d8-276c-e011-81d2-78e7d1fa76f8" target="_blank">WP7</a>). <strong>Panda!</strong> is one of our only completely free apps (No charge and no ads) and is released mostly to make me laugh. Although, <strong>Panda!</strong> is also one of our only apps to not actually serve any useful purpose, people still like to download it. Even though it's free, we are seeing the same reduction in overall downloads as with <strong>THE DOG</strong> (WP7 downloads are at roughly 5-10% of iOS downloads for the same periods).</p>
<p>This means that there is an even more fundamental question you have to answer besides your price point. Is developing the app even worth it?</p>
<p>We will probably continue to develop some WP7 apps (We love the OS and Mango is too good to ignore), but in some ways it's an act of faith. Faith that the platform will get better (and more popular) eventually leading to more profit and faith that our customers (end users and those contracting us to make the apps) want our products on multiple platforms.</p>
<p>All indications are that our faith is not misplaced. The app market (all platforms) is estimated to grow tremendously leading to more opportunity and (hopefully) more profit. WP7 is predicted to gain more market-share, and our customers have indicated they want us to support multiple platforms. We also love what we do and that certainly doesn't hurt!</p>
<p>But wait - weren't we talking about setting your app's price? Mobile development is a complex <em>business</em> and there is a lot to consider. Setting your app's price is just one part of that complexity and can be a bit (lot) like guesswork. Bottom line is that if you develop a good app and market it well, the price can be fiddled with until you hit the spot that's most profitable. You'll still probably have to adjust it from time to time, but your time is probably better spent trying to guess your way through everything else involved in becoming an overnight millionaire.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/06/02/pricing-your-app-and-is-wp7-worth-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP7 InputScope Tester</title>
		<link>http://www.wirebear.com/blog/2011/02/23/wp7-inputscope-tester/</link>
		<comments>http://www.wirebear.com/blog/2011/02/23/wp7-inputscope-tester/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 17:42:15 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[AutoCorrect]]></category>
		<category><![CDATA[InputScope]]></category>
		<category><![CDATA[Scoper]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[TextBox]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[wp7dev]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=683</guid>
		<description><![CDATA[A quick overview of InputScope usage in Windows Phone 7 apps and a downloadable project to help you try out all the InputScopes.]]></description>
			<content:encoded><![CDATA[<p>When developing a Windows Phone 7 app, you are going to use a TextBox control at some point. When you do, <em>please</em> set an InputScope value. This is one of the easiest ways to improve your user's experience, but it's amazing how many apps are released without using this feature. The InputScope changes the software keyboard and/or the behavior of the TextBox.</p>
<p><em>The InputScope shown to the left is "Chat", with the smilies selected.</em></p>
<p>As Shawn Wildermuth points out in his <a href="http://wildermuth.com/2011/02/04/Ten_Pet_Peeves_of_WP7_Applications" target="_blank">Ten Pet Peeves of WP7 Applications</a>:</p>
<blockquote><p>"... the default input scope on TextBox's do not offer AutoCorrect. So at a minimum changing the InputScope to <strong>Text</strong> will give the user auto-correct options. Using the case-specific InputScopes like EmailSmtpAddress, Chat, Number and FullName can help the user input data."</p></blockquote>
<p>Setting the Input Scope is as easy as changing this XAML:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextBox</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;txtMyText&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>To This:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextBox</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;txtMyText&quot;</span> <span style="color: #000066;">InputScope</span>=<span style="color: #ff0000;">&quot;Text&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Wowee, AutoCorrect and Word Suggestions magically start working! This is an area that new developers seem to miss and can find difficult to implement (<em>Intellisense only shows you the possible values if you use the long notation</em>). You can find an example of the long notation and a list of InputScopes <a href="http://www.imaginativeuniversal.com/blog/post/2010/07/06/WP7-InputScope.aspx" target="_blank">here</a>.</p>
<p>Reading the Imaginative Universe blog linked above and using some of the code demonstrated, I wrote an app to help me see and use the various InputScopes. I will provide a link to the full project below.</p>
<p>The app binds a ListBox to the full list of InputScopes (<em>and so will automatically include any additional InputScopes added in future releases</em>). Select an InputScope from the list and then tap the TextBox to see it in action.  Pretty simple, but useful for exploring the various InputScopes.</p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/02/Scoper1.png"><img class="size-medium wp-image-685" title="Scoper1" src="http://www.wirebear.com/blog/wp-content/uploads/2011/02/Scoper1-161x300.png" alt="" width="161" height="300" /></a> <a href="http://www.wirebear.com/blog/wp-content/uploads/2011/02/Scoper2.png"><img class="size-medium wp-image-686" title="Scoper2" src="http://www.wirebear.com/blog/wp-content/uploads/2011/02/Scoper2-161x300.png" alt="" width="161" height="300" /></a></p>
<p>The code is the property of WireBear, but you can feel free to use sections of it and to distribute this app (for free) with the WireBear name and link intact. Hopefully this helps you make more intuitive apps so that if nothing else, our experiences as users get improved!</p>
<h4>Resources:</h4>
<ul>
<li><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/02/WireBearScoper.zip">WireBearScoper</a> (WP7 C# Project)</li>
<li><a href="http://wildermuth.com/2011/02/04/Ten_Pet_Peeves_of_WP7_Applications" target="_blank">Ten Pet Peeves of WP7 Applications</a> (See # 1)</li>
<li><a href="http://www.imaginativeuniversal.com/blog/post/2010/07/06/WP7-InputScope.aspx" target="_blank">WP7 InputScope</a> (Scope list and examples)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/02/23/wp7-inputscope-tester/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Batch Updates with SharePoint 2007 Services</title>
		<link>http://www.wirebear.com/blog/2011/02/11/batch-updates-with-sharepoint-2007-services/</link>
		<comments>http://www.wirebear.com/blog/2011/02/11/batch-updates-with-sharepoint-2007-services/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 22:49:50 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[Lists]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=656</guid>
		<description><![CDATA[A guide to using SharePoint 2007 Web Service to perform Updates on multiple rows.]]></description>
			<content:encoded><![CDATA[<p>One of the biggest irritations to me coming from a SQL background is trying to do SQL like things in SharePoint 2007. One of those irritations is performing a simple update through the web services.  In SQL, I could write something like:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> ListTable
    <span style="color: #993333; font-weight: bold;">SET</span> FieldName <span style="color: #66cc66;">=</span> FieldValue
    <span style="color: #993333; font-weight: bold;">WHERE</span> QueryFieldName <span style="color: #66cc66;">=</span> QueryFieldValue</pre></div></div>

<p>In the generic T-SQL above, any row where the QueryFieldName column had a value equal to the QueryFieldValue would have it's FieldName Column set to FieldValue. Pretty straightforward for anyone with a database background.</p>
<p>With the SharePoint Web Services, however, there isn't a simple UPDATE command like this. Instead of the one simple command above, we have to make 2 calls to the Web Service and provide some complicated XML parameters. This can be a big hassle the first time you do this, so to hopefully save you some headaches, I'll provide most of the code required below...</p>
<p><span id="more-656"></span></p>
<p>I won't be showing you how to setup whatever project you are using or how to connect to the web service. The code is in C# and I will assume your service reference (<a href="http://msdn.microsoft.com/en-us/library/lists.lists_members(v=office.12).aspx" target="_blank">Lists</a>) is called myService.  So let's get started!</p>
<h3><span style="font-weight: normal;">Helper Functions:</span></h3>
<p>I will be using a few helper functions to make generating the XML parameters easier, I'll go ahead and list these here:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> AddAttribute<span style="color: #008000;">&#40;</span>XmlDocument x, <span style="color: #0600FF; font-weight: bold;">ref</span> XmlNode node,
          <span style="color: #6666cc; font-weight: bold;">string</span> attributename, <span style="color: #6666cc; font-weight: bold;">string</span> attributevalue,
          <span style="color: #6666cc; font-weight: bold;">string</span> AttributeNameSpace <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    XmlNode attnode <span style="color: #008000;">=</span>
              x<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Attribute</span>, attributename,
              AttributeNameSpace<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    attnode<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> attributevalue<span style="color: #008000;">;</span>
    node<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span>attnode<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> XmlNode CreateUpdateNode<span style="color: #008000;">&#40;</span>XmlDocument x, <span style="color: #6666cc; font-weight: bold;">int</span> ID, <span style="color: #6666cc; font-weight: bold;">string</span> RowID<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    XmlNode node <span style="color: #008000;">=</span> x<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;Method&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    AddAttribute<span style="color: #008000;">&#40;</span>x, node, <span style="color: #666666;">&quot;ID&quot;</span>, ID<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    AddAttribute<span style="color: #008000;">&#40;</span>x, node, <span style="color: #666666;">&quot;Cmd&quot;</span>, <span style="color: #666666;">&quot;Update&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    node<span style="color: #008000;">.</span><span style="color: #0000FF;">AppendChild</span><span style="color: #008000;">&#40;</span>CreateFieldNode<span style="color: #008000;">&#40;</span>x, <span style="color: #666666;">&quot;ID&quot;</span>, RowID<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> node<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> XmlNode CreateFieldNode<span style="color: #008000;">&#40;</span>XmlDocument x, <span style="color: #6666cc; font-weight: bold;">string</span> Name, <span style="color: #6666cc; font-weight: bold;">string</span> Value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    XmlNode node <span style="color: #008000;">=</span> x<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;Field&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    AddAttribute<span style="color: #008000;">&#40;</span>x, node, <span style="color: #666666;">&quot;Name&quot;</span>, Name<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    node<span style="color: #008000;">.</span><span style="color: #0000FF;">InnerText</span> <span style="color: #008000;">=</span> Value<span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> node<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<h2><span style="font-weight: normal;">Retrieve the Items to be Updated:</span></h2>
<p>This is equivalent to the WHERE clause of the example SQL query. You will need to use the <a href="http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx" target="_blank">GetListItems</a> method of the Lists service.</p>
<blockquote><p><em>This method uses the List GUID to reference the target list, I'll leave it to you to retrieve it and will assume it in the variable ListGUID. You will also need to replace the QueryFieldName, QueryFieldType, and QueryFieldValue variables with appropriate values.</em></p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">XmlDocument doc <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlDocument<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
XmlNode queryNode <span style="color: #008000;">=</span> doc<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;Query&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
queryNode<span style="color: #008000;">.</span><span style="color: #0000FF;">InnerXml</span> <span style="color: #008000;">=</span>
          <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='{0}' /&gt;
                         &lt;Value Type='{1}'&gt;{2}&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&quot;</span>,
          QueryFieldName, QueryFieldType, QueryFieldValue<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
XmlNode viewNode <span style="color: #008000;">=</span> doc<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;ViewFields&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
viewNode<span style="color: #008000;">.</span><span style="color: #0000FF;">InnerXml</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&lt;FieldRef Name='ID'/&gt;&quot;</span><span style="color: #008000;">;</span>
&nbsp;
XmlNode resultsNode <span style="color: #008000;">=</span> myService<span style="color: #008000;">.</span><span style="color: #0000FF;">GetListItems</span><span style="color: #008000;">&#40;</span>ListGUID, <span style="color: #0600FF; font-weight: bold;">null</span>, queryNode,
          viewNode, <span style="color: #0600FF; font-weight: bold;">null</span>,
          doc<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;QueryOptions&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<h3><span style="font-weight: normal;">Parse the IDs from the Results:</span></h3>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">XmlNamespaceManager nsmgr <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlNamespaceManager<span style="color: #008000;">&#40;</span>doc<span style="color: #008000;">.</span><span style="color: #0000FF;">NameTable</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
nsmgr<span style="color: #008000;">.</span><span style="color: #0000FF;">AddNamespace</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;z&quot;</span>, <span style="color: #666666;">&quot;#RowsetSchema&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
XmlNodeList rowNodes <span style="color: #008000;">=</span> resultsNode<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectNodes</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;.//z:row&quot;</span>, nsmgr<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&gt;</span> IDs <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>XmlNode rowNode <span style="color: #0600FF; font-weight: bold;">in</span> rowNodes<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    XmlAttribute result <span style="color: #008000;">=</span> rowNode<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;ows_ID&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    IDs<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Parse</span><span style="color: #008000;">&#40;</span>result<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<h2><span style="font-weight: normal;">Perform the Update:</span></h2>
<p>This is equivalent to the SET portion of the example SQL query. You will need to use the<a href="http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems(v=office.12).aspx" target="_blank"> UpdateListItems</a> method of the Lists service.</p>
<blockquote><p><em>Again, this method uses the List GUID to reference the target list, I'll leave it to you to retrieve it and will assume it in the variable ListGUID. You will also need to replace the FieldName and FieldValue variables with appropriate values.</em></p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">XmlDocument doc2 <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlDocument<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
XmlNode node <span style="color: #008000;">=</span> doc2<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateNode</span><span style="color: #008000;">&#40;</span>XmlNodeType<span style="color: #008000;">.</span><span style="color: #0000FF;">Element</span>, <span style="color: #666666;">&quot;Batch&quot;</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
AddAttribute<span style="color: #008000;">&#40;</span>doc2, node, <span style="color: #666666;">&quot;OnError&quot;</span>, <span style="color: #666666;">&quot;Continue&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #6666cc; font-weight: bold;">int</span> itemCount <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #0600FF; font-weight: bold;">in</span> IDs<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    XmlNode updateNode <span style="color: #008000;">=</span> CreateUpdateNode<span style="color: #008000;">&#40;</span>doc2, itemCount, i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    updateNode<span style="color: #008000;">.</span><span style="color: #0000FF;">AppendChild</span><span style="color: #008000;">&#40;</span>CreateFieldNode<span style="color: #008000;">&#40;</span>doc2, FieldName, FieldValue<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080; font-style: italic;">//Append More children here to update multiple fields</span>
    node<span style="color: #008000;">.</span><span style="color: #0000FF;">AppendChild</span><span style="color: #008000;">&#40;</span>updateNode<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    itemCount <span style="color: #008000;">+=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
myService<span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateListItems</span><span style="color: #008000;">&#40;</span>ListGUID, node<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>That's it. To review, we created a CAML query and retrieved the IDs of the matching rows using the GetListItems method. We parsed the XML result and put all of those IDs in a List&lt;int&gt;. We then added each row ID to a batch update XML parameter which we used in the UpdateListItems method.</p>
<p>As you can see, this is way more complicated and not nearly as obvious as a SQL UPDATE command, but you can take the above code and create a pretty generic wrapper to make your web service updates nearly as easy. Let me know how it works out for you or if you have any questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/02/11/batch-updates-with-sharepoint-2007-services/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t Use the Word Fox in App Store Description?</title>
		<link>http://www.wirebear.com/blog/2011/01/26/cant-use-the-word-fox-in-app-store-description/</link>
		<comments>http://www.wirebear.com/blog/2011/01/26/cant-use-the-word-fox-in-app-store-description/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 02:33:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WireBear]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=644</guid>
		<description><![CDATA[We ran across the following warning today when updating our App Store Description for our dog iPhone app: The following is not recommended for use in this field: Fox. Your app may be rejected if you use this term. Our app has a list of nearly 100 dog breeds with one of them being the [...]]]></description>
			<content:encoded><![CDATA[<p>We ran across the following warning today when updating our App Store Description for our <a href="http://itunes.apple.com/us/app/the-dog/id401777147?mt=8#">dog iPhone app</a>:</p>
<p><a href="http://www.wirebear.com/blog/2011/01/26/cant-use-the-word-fox-in-app-store-description/appstore_metadata/" rel="attachment wp-att-645"><img src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/AppStore_Metadata-300x169.jpg" alt="App Store Description Warning" title="AppStore_Metadata" width="300" height="169" class="aligncenter size-medium wp-image-645" /></a></p>
<p><em>The following is not recommended for use in this field: Fox. Your app may be rejected if you use this term.</em></p>
<p>Our app has a list of nearly 100 dog breeds with one of them being the Wire Fox Terrier.  I guess we don't understand when Fox became a word that was off limits.</p>
<p>Does anybody have any ideas why using the term Fox is not recommended in your app's App Store description?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/01/26/cant-use-the-word-fox-in-app-store-description/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LiquidOffice Retry on Exception</title>
		<link>http://www.wirebear.com/blog/2011/01/18/liquidoffice-retry-on-exception/</link>
		<comments>http://www.wirebear.com/blog/2011/01/18/liquidoffice-retry-on-exception/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 13:00:31 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LiquidOffice]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Delay]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[FAIL]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[Reset]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=623</guid>
		<description><![CDATA[A quick demonstration on how to add retry loops to tasks that throw exceptions in LiquidOffice processes]]></description>
			<content:encoded><![CDATA[<p>LiquidOffice tasks can fail for a number of reasons. By default, a failed task halts the entire process and you will have to manually skip the task, delete the process or take some other action using Management Console. Sometimes, however, wouldn't it be nice if the failed task waited a certain amount of time then retried?</p>
<p>We have found this to be especially helpful for web service tasks. Calls to web services can fail if the server has gone offline for a minute, but could recover if tried in 10 minutes or so. So we have added an exception loop to each of our web service tasks that retries indefinitely.</p>
<p>Here is the process:</p>
<p><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/ExceptionLoop-Process.png"><img class="aligncenter size-medium wp-image-624" title="ExceptionLoop Process" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/ExceptionLoop-Process-288x300.png" alt="" width="288" height="300" /></a></p>
<p>On this process you can see we have a Form task and then a script task called FailTask. The FailTask is pretty simple, it just throws an exception. Here is the code inside the FailTask:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> enteredActive<span style="color: #009900;">&#40;</span>State state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  Log log <span style="color: #339933;">=</span> LogFactory.<span style="color: #006633;">getLog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FAIL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  thisProcess.<span style="color: #006633;">setFieldValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FakeField&quot;</span>,<span style="color: #0000ff;">&quot;panda&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So we write a message to the log then try to set the value on a field that doesn't exist. FAIL! The next task, Other Stuff, will never be reached in this particular example, but is representative of the rest of your process.</p>
<p>The other four tasks are the interesting ones. First is an Exception task. An exception task is just a task that becomes active when the task it is connected to (with a red line) throws an exception - pretty straightforward. After the exception task we have placed a Delay task. This is the task that determines how long the process should wait before retrying.</p>
<p>The most important task is the Reset State script task. Here is the code inside:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> enteredActive<span style="color: #009900;">&#40;</span>State state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  thisProcess.<span style="color: #006633;">getTaskByName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FailTask&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">forceToState</span><span style="color: #009900;">&#40;</span>State.<span style="color: #006633;">READY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<blockquote><p><em>(This Code can also be placed in the Delay task on the enteringDone event, we have separated it into a separate Script task just to make it easy to understand)</em></p></blockquote>
<p>This code retrieves the failed task (whatever task you are attaching the exception loop too) and sets its' state to <em>READY</em>. This command will fail if the task is not currently at state <em>ABORT</em>, so just make sure to only put this code inside your exception loop.</p>
<p>The last member of this loop is the strangest, the Loop task. The loop task is between the Delay task and the Exception task and does NOT link back to the main process (Fail Task). Resetting the state of the Failed task immediately activates it (which is why we reset AFTER the delay task). The loop is only there to reactivate the exception task so that if the Failed task fails again, the exception loop starts over.</p>
<p>In our example above the process will retry forever until it succeeds. You could easily add conditions to the loop task to determine how often it should run and this will be the equivalent of a retry count (since the exception task will never be reactivated).</p>
<p>Adding these types of loops to your processes can help them to be more robust and keep you from having to intervene on recoverable tasks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/01/18/liquidoffice-retry-on-exception/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run as different user</title>
		<link>http://www.wirebear.com/blog/2011/01/13/run-as-different-user/</link>
		<comments>http://www.wirebear.com/blog/2011/01/13/run-as-different-user/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 15:51:04 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Run as]]></category>
		<category><![CDATA[ShellRunas]]></category>
		<category><![CDATA[SQL Management Studio]]></category>
		<category><![CDATA[Sysinternals]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=609</guid>
		<description><![CDATA[If you've ever had to run a program as a different user than the one you were logged in as you might have been surprised the first time you used Vista or Windows 7 to not see the friendly "Run as different user..." option in your context menu. On Vista, this option was removed completely. [...]]]></description>
			<content:encoded><![CDATA[<p>If you've ever had to run a program as a different user than the one you were logged in as you might have been surprised the first time you used Vista or Windows 7 to not see the friendly "Run as different user..." option in your context menu.</p>
<p>On Vista, this option was removed completely. On Windows 7 you have to hold <em>Shift </em>while right-clicking to get it to show up. This is not obvious and can be irritating.</p>
<p>I recently came across a tool by Sysinternals (now Microsoft) called <a href="http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx" target="_blank">ShellRunas</a>.  <strong>Go get it.</strong> To restore your context menu do this:</p>
<ol>
<li>Extract the <em>ShellRunas.exe</em> to your <em>C:\Windows\System32</em> directory</li>
<li>Open a command prompt (as Administrator), type:<br />
<em>ShellRunas.exe /reg</em></li>
</ol>
<p>Your context menu has been restored!  That's pretty awesome by itself, but something I like to do is use it to create shortcuts.</p>
<p>A common occurrence for me is the need to run Microsoft SQL Management Studio as a different user to login to a server that only accepts Windows Authentication. This is a classic Run as different user scenario, but I can't tell you how many times I have opened it up and tried to connect only to remember I have to restart the whole program with the Run as different user option.  So I created a shortcut by doing this:</p>
<ol>
<li>Copied my current shortcut to Management Studio and pasted it to create a new one</li>
<li>Right-Clicked on the shortcut and selected <em>Properties</em></li>
<li>Changed the target to:<br />
<em>C:\Windows\System32\ShellRunas.exe "C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"</em><br />
<span style="color: #999999;">(your path may be different) </span></li>
</ol>
<p>Now when I run that shortcut I am automatically prompted for my credentials!  But there is another feature of ShellRunas that can make your shortcut even better.  If I change the target setting from above to this:<br />
<em>C:\Windows\System32\ShellRunas.exe /netonly "C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"</em></p>
<p>That <em>/netonly </em>section uses the alternate credentials only on remote calls.  This means that in Management Studio (or whatever program) I can access all my documents (as long as they aren't mapped to a network share) and still be using the correct credentials when accessing the remote server!</p>
<p>Just a simple but effective tool that makes my job easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/01/13/run-as-different-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free SharePoint 2007 Themes</title>
		<link>http://www.wirebear.com/blog/2011/01/07/free-sharepoint-2007-themes/</link>
		<comments>http://www.wirebear.com/blog/2011/01/07/free-sharepoint-2007-themes/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 13:00:49 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[STSADM]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://www.wirebear.com/blog/?p=572</guid>
		<description><![CDATA[A while back Microsoft released 10 new SharePoint 2007 themes (for MOSS or WSS).  They look pretty good (see screenshots below), but they packaged them in a very strange way.  Instead of releasing them as WSP packages for end users to install, they released them as Visual Studio projects requiring a developer to compile them [...]]]></description>
			<content:encoded><![CDATA[<p>A while back Microsoft released 10 new SharePoint 2007 themes (for MOSS or WSS).  They look pretty good (see screenshots below), but they packaged them in a very strange way.  Instead of releasing them as WSP packages for end users to install, they released them as Visual Studio projects requiring a developer to compile them into packages to be deployed.</p>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=0a87658f-20b8-4dcc-ad7a-09ad22641f3a" target="_blank">Download the original samples from Microsoft</a></p>
<p>While I see a lot of value in having sample code for theme deployment, most SharePoint admins don't have all the tools required to compile these into a usable format. <strong>That means the above download is basically unusable for anyone who doesn't have these tools.</strong></p>
<p>A guy named Daniel Brown made the WSP packages available, but all the links are now dead (it <em>has</em> been a while).  I have the tools, but even I was annoyed that I had to open each project, compile/package them, and then deploy.  So... I have decided to release the packages myself!  I've looked through the EULA included with the original download and I don't think I'm in violation, but I'm sure I'll soon find out if I am!</p>
<p>I have not modified a single image or line of code from the samples.  All I did was package them up to provide to you along with the instructions to make these a part of your server. Having said that, WireBear claims no ownership or credit for these themes nor do we provide any guarantee of success, warranty, support, etc.  But they are free...</p>
<p><span id="more-572"></span></p>
<h2><span style="font-weight: normal;">The Themes</span></h2>
<p>There are 10 Themes available.  I have provided a separate download for each one, but at the end of the article you can find a link to download them together.  <em>Once again, please note the Screenshots are from Microsoft and we claim no ownership!</em></p>
<p style="text-align: center;"><em><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Team_Preview.jpg"><img class="aligncenter size-medium wp-image-580" title="Team_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Team_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Team.zip">Team Theme</a></em></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Start-Up_Preview.jpg"><img class="aligncenter size-medium wp-image-584" title="Start-Up_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Start-Up_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/StartUp.zip">StartUp Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/sporting_Preview.jpg"><img class="aligncenter size-medium wp-image-586" title="sporting_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/sporting_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Sporting.zip">Sporting Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Publishing_Preview.jpg"><img class="aligncenter size-medium wp-image-588" title="Publishing_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Publishing_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Publishing.zip">Publishing</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Procurement_Preview.jpg"><img class="aligncenter size-medium wp-image-590" title="Procurement_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Procurement_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Procurement.zip">Procurement Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/OARP_Preview.jpg"><img class="aligncenter size-medium wp-image-592" title="OARP_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/OARP_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/OARP.zip">OARP Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Events_Preview.jpg"><img class="aligncenter size-medium wp-image-594" title="Events_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Events_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Events.zip">Events Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Corporate_Preview.jpg"><img class="aligncenter size-medium wp-image-596" title="Corporate_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Corporate_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Corporate.zip">Corporate Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Contoso_Preview.jpg"><img class="aligncenter size-medium wp-image-598" title="Contoso_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Contoso_Preview-300x218.jpg" alt="" width="300" height="218" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Contoso.zip">Contoso Theme</a></p>
<p style="text-align: center;"><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Construction_Preview.jpg"><img class="aligncenter size-medium wp-image-601" title="Construction_Preview" src="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Construction_Preview-300x288.jpg" alt="" width="300" height="288" /></a><a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/Construction.zip">Construction Theme</a></p>
<h2>Installation</h2>
<p>To install these, you can either use the stsadm tool and add, deploy and activate them like any other feature  or you can run the included setup.bat to have the theme installed for you (may have to play with the options depending on your setup).  <em>Please note that activating these themes will set it as the current theme for the target site.</em></p>
<p>Download <a href="http://www.wirebear.com/blog/wp-content/uploads/2011/01/SP2007_10_Themes.zip">All Theme Packages</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2011/01/07/free-sharepoint-2007-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding color to your Dynamic tables in LiquidOffice</title>
		<link>http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/</link>
		<comments>http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 13:00:47 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[LiquidOffice]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[Colors]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Dynamic Tables]]></category>

		<guid isPermaLink="false">http://wirebear.com/blog/?p=513</guid>
		<description><![CDATA[Colorize your LiquidOffice dynamic table buttons in three quick steps.]]></description>
			<content:encoded><![CDATA[<p>In many of our LiquidOffice forms we use the dynamic table controls with row addition and removal turned on. You can see a sample on the left of a very simple form showing this behavior in Internet Explorer.  This works pretty well, but we recently had a seemingly simple request to change the color of the add (+) and remove (-) buttons.  There are several things you can customize in your form just by adjusting some properties, but the color of these buttons are not currently available as settings.</p>
<p>So what are our options?  We posed that question to Autonomy technical support and they came back with a couple of methods to get to these buttons in javascript and to set their color there.  We needed this behavior on multiple tables on the same form and on multiple forms so we put together a method using their help to come up with a pretty simple solution...</p>
<p><span id="more-513"></span>The heart of it is the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Sets the colors of the + and - buttons for dynamic tables</span>
<span style="color: #003366; font-weight: bold;">function</span> ColorizeButtons<span style="color: #009900;">&#40;</span>tableName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> tbl <span style="color: #339933;">=</span> CSForm.<span style="color: #660066;">getTable</span><span style="color: #009900;">&#40;</span>tableName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> addColor <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;699A41&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> remColor <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;BF3834&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tbl <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> tbl.<span style="color: #660066;">isDynamic</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tbl.<span style="color: #660066;">isRowAdditionAllowed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> addButton <span style="color: #339933;">=</span> CSForm.<span style="color: #660066;">getField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DFS__&quot;</span> <span style="color: #339933;">+</span> tableName <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_addRow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>addButton <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        addButton.<span style="color: #660066;">setFillColor</span><span style="color: #009900;">&#40;</span>addColor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        addButton.<span style="color: #660066;">setTextColor</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;FFFFFF&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tbl.<span style="color: #660066;">isRowRemovalAllowed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;=</span><span style="color: #009900;">&#40;</span>tbl.<span style="color: #660066;">getNumberOfRows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> remButton <span style="color: #339933;">=</span> CSForm.<span style="color: #660066;">getField</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;DFS__&quot;</span><span style="color: #339933;">+</span>tableName<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;_removeRow_&quot;</span><span style="color: #339933;">+</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>remButton <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          remButton.<span style="color: #660066;">setFillColor</span><span style="color: #009900;">&#40;</span>remColor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          remButton.<span style="color: #660066;">setTextColor</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;FFFFFF&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To use this, open up the script editor in the Form Designer (<em>Tools &gt; Script Editor</em>).  Expand your form and click on the <em>&lt;Client&gt;</em> node and paste the above code.  Then expand the <em>&lt;Client&gt;</em> node and then expand the <em>CSForm</em> node and double click the <em>OnLoad()</em> event to add the function.  In this event add a call to the above function for EACH dynamic table on your form where you want the buttons colored using the name of the table as the parameter (Our sample table is named <em>GreatStuff</em>).  For the test form we're using our <em>OnLoad</em> event looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> CSForm_OnLoad<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  ColorizeButtons<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;GreatStuff&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then for EACH dynamic table on your form find the table's main node in the <em>&lt;Client&gt;</em> node on the right and expand it and double click the <em>OnRowAdded()</em> event and set the code like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> GreatStuff_OnRowAdded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  ColorizeButtons<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;GreatStuff&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Your Script Editor should look similar to this:</p>
<p><a rel="attachment wp-att-516" href="http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/scripteditor/"><img class="aligncenter size-medium wp-image-516" title="ScriptEditor" src="http://wirebear.com/blog/wp-content/uploads/2010/11/ScriptEditor-300x285.png" alt="" width="300" height="285" /></a></p>
<p>Press F5 to save and compile.  That's it.  Just test the form (<em>File &gt; Preview &gt; As HTML</em>) .  With most recent versions of Internet Explorer you will be prompted during the preview with a yellow message bar at the top of the page saying that it has restricted content from the page. This will only happen on your local machine and is a good, but annoying, security feature. Just click on the message and choose <em>Allow Blocked Content...</em> and all your scripts will run just fine.</p>
<p><a rel="attachment wp-att-517" href="http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/allowblockedcontent/"><img class="aligncenter size-medium wp-image-517" title="AllowBlockedContent" src="http://wirebear.com/blog/wp-content/uploads/2010/11/AllowBlockedContent-300x129.png" alt="" width="300" height="129" /></a></p>
<p>Now your plus (+) buttons should be green and your minus (-) buttons should be red:</p>
<p><a rel="attachment wp-att-518" href="http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/dynamictablecolored/"><img class="aligncenter size-full wp-image-518" title="DynamicTableColored" src="http://wirebear.com/blog/wp-content/uploads/2010/11/DynamicTableColored.png" alt="" width="271" height="189" /></a></p>
<p>That's all there is to it.  The buttons aren't beautiful, but now they're easier to see and the colors you choose can help indicate their function or match your logo.  To customize the colors used, just edit the ColorizeButtons function listed above with the hexadecimal color values in a string (without the #).  This is a pretty standard format found in HTML and you can easily find sites out there to help you with these.  A good and easy one is <a href="http://www.colorpicker.com/" target="_blank">ColorPicker.com</a>.  You can just adjust your colors right on the site and it gives you the hex value right at the top.  Just copy it and remove the #.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">  <span style="color: #003366; font-weight: bold;">var</span> addColor <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;699A41&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> remColor <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;BF3834&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To change the text color just edit the setTextColor("") calls using the same types of values (the code above uses white "FFFFFF").</p>
<p>Let us know if you find this useful or if there are other tricks you use to help customize your forms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2010/11/26/adding-color-to-your-dynamic-tables-in-liquidoffice/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding a Suicide Loop to your LiquidOffice process</title>
		<link>http://www.wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/</link>
		<comments>http://www.wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 19:36:29 +0000</pubDate>
		<dc:creator>ckent</dc:creator>
				<category><![CDATA[LiquidOffice]]></category>
		<category><![CDATA[WireBear]]></category>
		<category><![CDATA[Autonomy]]></category>
		<category><![CDATA[Cardiff]]></category>
		<category><![CDATA[Escalate]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Or]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Suicide Loop]]></category>
		<category><![CDATA[Zombie]]></category>

		<guid isPermaLink="false">http://wirebear.com/blog/?p=416</guid>
		<description><![CDATA[Creating processes in LiquidOffice that timeout appropriately.]]></description>
			<content:encoded><![CDATA[<p>If you've ever created a semi-complex process in LiquidOffice you might have run into a common problem - zombie processes.  Zombie Processes are processes that never completed but they aren't being actively used either. Generally these have to be manually killed using the Management Console.</p>
<p>This isn't LiquidOffice's fault, it's doing what it's supposed to, but depending on your environment this can be a big problem and a huge irritation.  Fortunately, we can use LiquidOffice to solve this problem quickly and simply with just a few additions to your process...</p>
<p><span id="more-416"></span></p>
<p>The most common cause of zombie processes is having a <em>"choose your own adventure"</em> type process with multiple forms.  Consider the following process:</p>
<p><a rel="attachment wp-att-417" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/zombieprocess/"><img class="aligncenter size-full wp-image-417" title="ZombieProcess" src="http://wirebear.com/blog/wp-content/uploads/2010/11/ZombieProcess.png" alt="" width="550" height="111" /></a></p>
<p>In the above generic process we have two forms and two script tasks.  The script tasks are just there to serve as placeholders for whatever tasks you might be doing between and after forms.  Often in a more complex process you would have some sort of branch task that changed what the second form was or altered some fields depending on the result of the first form.  But to keep things simple this is our sample process.</p>
<blockquote><p><em>Note - We have checked the "Automatically Display Next Form on Submit" property in the Form section of the first form task's properties.  At this point our process also does not take advantage of the Initial Form property (we will cover that further down).</em></p></blockquote>
<p>In our common BeanShell script area we have the following generic function:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Writes a message to the Log</span>
<span style="color: #000066; font-weight: bold;">void</span> writeToLog<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> Message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  Log log <span style="color: #339933;">=</span> LogFactory.<span style="color: #006633;">getLog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span>Message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This is a simple helper function we use to save time when we write to the log.  Using this in the More Stuff task (final script task) we have:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> enteredActive<span style="color: #009900;">&#40;</span>State state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  writeToLog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;All forms processed!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So if everything goes well, the final thing our process does is to write to the event log to let us know it's all done.  But what happens if when a user gets to the second process they realize they messed up the first form so they close the window and start over?  A good solution is to provide a back button (See our <a href="http://wirebear.com/blog/2010/10/25/multiple-submit-buttons-in-liquidoffice/" target="_blank">Multiple Submit Buttons in LiquidOffice</a> article).  However, not everyone will use a back button no matter how convenient and it still doesn't account for people who either accidentally or purposely closed the window for whatever reason.</p>
<p>When this happens as far as the user is concerned the process is gone, but LiquidOffice holds onto the instance, all of it's data, the versions of the form(s) and the process that were used, and the current state of the process.  All of this will need to be cleaned out manually using Management Console and in some versions of LiquidOffice the process isn't fully cleaned up on manual deletion.</p>
<h2>Fixed Lifespan</h2>
<p>The Fixed Lifespan solution is very easy to implement.  Here is our example from above with a Fixed Lifespan:</p>
<p><a rel="attachment wp-att-548" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/lifespan/"><img title="LifeSpan" src="http://wirebear.com/blog/wp-content/uploads/2010/11/LifeSpan.png" alt="" width="535" height="170" /></a></p>
<p>Only two controls were added to the process.  An Or block and a Delay task with no parent tasks (no preceding connections).  The Delay time you set is equal to the lifespan of the entire process.  The Or block needs to be the last item in your process and allows us to say, <em>"however you get here, end".</em> If the tasks all complete before the delay expires then the process performs as expected and the delay task is ignored.  However, if the delay expires, the Or block at the end cancels out the rest of the process tree and the process gracefully dies.</p>
<p>This works because both Form 1 and the Delay task are started at the same time (process instantiation).  So it's a race.</p>
<p>This makes for a very simple solution but should be used with extreme caution.  This is especially true for large processes which require approval, manual operations, or special routing.  You will need to take into account all reasonable time frames for each task to complete and make sure your Delay task is set much higher.</p>
<p>Estimating an appropriate lifespan and maintaining adjustments to that lifespan as the process changes can be difficult and error prone.  Many times you only want specific tasks to timeout and you'd like that timeout to be relative to each task.  For example, once a user has submitted the form(s) you probably don't want an automatic timeout.  So what do you do when you only want to target certain tasks and you'd like those timeouts to be relative to the task they are timing out?</p>
<h2>A Better Solution:</h2>
<p>With the help of Autonomy tech support (Thanks Simon!) we have come up with a solution that fits that criteria and that we add to nearly every process we publish.  We call it a suicide loop because that sounds cool (right??), but that might lead you to believe that we are just forcing a delete on the process from within the process.  In actuality, we are still gracefully completing the process allowing for standard cleanup and for statistics to maintain their integrity.  In addition, you can add whatever code you want when this happens (send an email, write to the log, etc.).</p>
<p>The solution involves adding an Escalate task, some other task(s), and an Or block:</p>
<p style="text-align: center;"><a rel="attachment wp-att-435" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/suicidesimple/"><img class="aligncenter size-full wp-image-435" title="SuicideSimple" src="http://wirebear.com/blog/wp-content/uploads/2010/11/SuicideSimple.png" alt="" width="613" height="139" /></a></p>
<p>The escalation task needs to be attached to the form causing the problem (Form 2 above). Ensure your <em>Delay until escalation</em> property is set to a relatively high number to allow the user the chance to fill it out.  For testing we set ours to 1 minute (0:01:00.000), but a value of 24-72 hours is generally more appropriate.  To be clear, this is the amount of time the form (NOT the entire process) can be left open (zombie or not) before the process is sent to heaven - so you will need to pick it carefully.</p>
<p>If the form is submitted before the escalation delay then the process continues on as expected and the escalation task is cancelled.  However, if the escalate occurs, the Or block at the end cancels out the rest of the process tree and the process gracefully dies.</p>
<p>Wait a second, what about that extra script task between the escalate task and the Or block? This is <strong>REQUIRED</strong>.  This can be a blank script task (does nothing) or something else like an email task (or whatever other business logic you want to insert), but you must have something here.  This is because although the escalate task is cancelled, it "shows" as completed which signals the Or block to be followed - cancelling the process immediately.  Placing something here changes that.  In our process above, when the escalate task is cancelled the Script task is set to Passive which prevents it from executing and therefore stops the path.</p>
<p>Our script task does this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> enteredActive<span style="color: #009900;">&#40;</span>State state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  writeToLog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Goodbye Cruel World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If you run this process, close the window on (don't submit) the second form and you'll see the "Goodbye Cruel World!" message in the System:EventLog within the Management Console (after the escalation delay).  You'll also find the instance is marked as complete.  The process can also be completed normally (all forms submitted) and the suicide loop will never be entered.</p>
<p>Congratulations, it was really that simple!  Unless of course, it wasn't...</p>
<h2>Multiple Suicide Loops:</h2>
<p>In most cases the above solution should have taken care of your problem.  But if any of the following are true, you will need to add additional loops:</p>
<ul>
<li>Multiple forms where a user could stall out</li>
<li>Using the process <em>Initial Form</em> setting set to <em>Instantiate Process Before Display Form</em></li>
</ul>
<p>Using our same process from above we have now set the process <em>Initial Form</em> property to <em>Use Initial Form</em> and set it to <em>Instantiate Process Before Displaying Form</em>:</p>
<p><a rel="attachment wp-att-442" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/processsetting/"><img class="aligncenter size-full wp-image-442" title="ProcessSetting" src="http://wirebear.com/blog/wp-content/uploads/2010/11/ProcessSetting.png" alt="" width="265" height="167" /></a></p>
<p>This effectively means our process has multiple forms where a user could stall out.  So this means we need a way to kill the process on either form 1 or form 2 being abandoned.  This really just means we have to add another suicide loop (one for each stall point).  This isn't that complicated but it's a little annoying.</p>
<p>LiquidOffice doesn't allow the escalate task to be attached to more than one task (the pink line).  This means you need a separate escalate task for each stall point.  This creates a new path for each stall point that can be joined back together for one final suicide task(s) as needed, but ultimately every path in your process needs to end in that final Or block.</p>
<p>Unfortunately, you can't just have each escalate task point to the same inbetween task (the "Goodbye Cruel World" script in our example).  Because then the process will stall out at this task since it will be waiting for the other escalate task(s) to also reach that point before continuing.  You also can't simply add an Or block before the imbetween task or you will have the same problem as before with the Or block being activated when the escalate task is cancelled.</p>
<p>So you need to add the "full" suicide loop for each stall point like this:</p>
<p style="text-align: center;"><a rel="attachment wp-att-445" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/suicidemultiple/"><img class="aligncenter size-full wp-image-445" title="SuicideMultiple" src="http://wirebear.com/blog/wp-content/uploads/2010/11/SuicideMultiple.png" alt="" width="607" height="202" /></a></p>
<p>This is a pretty simple implementation.  But what if you wanted to send an email (or some other logic) every time a process stalled out?  You could just cut and paste and replace the imbetween script tasks with these tasks, but maintenance would be a nightmare and your process tree could quickly get huge.  So do something like this:</p>
<p style="text-align: center;"><a rel="attachment wp-att-446" href="http://wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/suicidecomplex/"><img class="aligncenter size-full wp-image-446" title="SuicideComplex" src="http://wirebear.com/blog/wp-content/uploads/2010/11/SuicideComplex.png" alt="" width="606" height="204" /></a></p>
<p>As you can see we still have a generic script task after our escalate tasks, but these do nothing.  We have moved our <em>Finally</em> logic between the Or blocks.</p>
<p>Although the suicide loop is more complex than the fixed lifespan, the benefits are worth it. Regardless of exact implementation, the prevention of zombie processes is an important part of your design for EACH process.  These are our methods, what do you guys do?  Any other process maintenance tips? Let us know in the comments!</p>
<blockquote>
<h6><span style="font-weight: normal;"><em><span style="color: #808080;">Zombie Image from <a href="http://gear.ign.com/articles/949/949442p1.html">http://gear.ign.com/articles/949/949442p1.html</a></span></em></span></h6>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.wirebear.com/blog/2010/11/22/adding-a-suicide-loop-to-your-liquidoffice-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

