A WORKFLOW SMORGASBORD in Word

Generate Data Matrix in Word A WORKFLOW SMORGASBORD

CHAPTER 9 A WORKFLOW SMORGASBORD
Generate Data Matrix ECC200 In None
Using Barcode maker for Office Word Control to generate, create Data Matrix image in Microsoft Word applications.
www.OnBarcode.com
EAN128 Generator In None
Using Barcode generation for Office Word Control to generate, create GS1-128 image in Word applications.
www.OnBarcode.com
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Paint Data Matrix 2d Barcode In None
Using Barcode generation for Microsoft Word Control to generate, create Data Matrix ECC200 image in Office Word applications.
www.OnBarcode.com
Encoding USS Code 128 In None
Using Barcode drawer for Microsoft Word Control to generate, create Code 128 Code Set B image in Office Word applications.
www.OnBarcode.com
sTemp = sFullName.Replace(sDocName, String.Empty); sTemp = sTemp.TrimEnd('/'); sDocLibName = sTemp.Substring(sTemp.LastIndexOf("/") + 1); } else { sDocLibName = sTemp.Substring(0, sTemp.IndexOf('/')); } sSiteURL = this.FullName.Substring(0, this.FullName. IndexOf(sDocLibName)); sFolders = sTemp.Replace(sDocLibName, string.Empty); sFolders = sFolders.Replace(sDocName, string.Empty); sFolders = sFolders.Replace(sSiteURL, string.Empty); } else { sTemp = sFullName.Replace(sDocName, String.Empty); sTemp = sTemp.TrimEnd('/'); sDocLibName = sTemp.Substring(sTemp.LastIndexOf("/") + 1); sSiteURL = this.FullName.Substring(0, this.FullName. IndexOf(sDocLibName)); } return true; } else { return false; } } catch (Exception ex) { return false; } }
Print QR In None
Using Barcode maker for Word Control to generate, create QR Code ISO/IEC18004 image in Microsoft Word applications.
www.OnBarcode.com
Creating EAN-13 Supplement 5 In None
Using Barcode maker for Microsoft Word Control to generate, create EAN13 image in Microsoft Word applications.
www.OnBarcode.com
The next method called from our startup method is CheckForWFTasks. This method, shown in its entirety in Listing 9-6, is pretty simple. It is basically just the call to the web service we created earlier. It returns an XMLNode that contains any task information. Listing 9-6. Calling the Web Service and Passing Back the XML private XmlNode CheckForWFTasks() { WFTaskService.WFTask wft = new WFTaskService.WFTask(); wft.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; XmlNode xNode = wft.GetWFTasks(sSiteURL, sDocLibName, sFolders, sDocName); return xNode; }
Barcode Creator In None
Using Barcode generation for Office Word Control to generate, create Barcode image in Word applications.
www.OnBarcode.com
Codabar Encoder In None
Using Barcode generation for Microsoft Word Control to generate, create Monarch image in Microsoft Word applications.
www.OnBarcode.com
CHAPTER 9 A WORKFLOW SMORGASBORD
Encode Data Matrix In None
Using Barcode drawer for Office Excel Control to generate, create Data Matrix image in Excel applications.
www.OnBarcode.com
Data Matrix Encoder In Java
Using Barcode maker for Java Control to generate, create ECC200 image in Java applications.
www.OnBarcode.com
Next up is the method to parse the XML and set the values into the variables we created way back in Listing 9-3. Before we show this code, let s take a look at the XML we ll be getting back. There s really only two pieces of information we need here the name of the task and the URL for the task form so it s pretty simple. Take a look at Listing 9-7 to see what it looks like. Listing 9-7. An Example of the XML We ll Get Back from Our Web Service <WorkFlowTask> <TaskName>Task 1</TaskName> <TaskURL>http://mossrtm/o2003/Lists/Tasks/DispForm.aspx ID=4</TaskURL> </WorkFlowTask> Now let s parse that out and assign the values back into our variables. Listing 9-8 shows the GetValuesFromXML method referenced in our startup method. Again, there s not much to this method, either; a couple of SelectSingleNode calls and we re pretty well done with this method. Listing 9-8. Parsing Out the Retrieved XML to Get Our Task Information private bool GetValuesFromXML(XmlNode xNode) { try { sTaskName = xNode.SelectSingleNode("/TaskName/text()").Value; sTaskURL = xNode.SelectSingleNode("/TaskURL/text()").Value; if ((sTaskName != string.Empty) && (sTaskURL != string.Empty) ) { return true; } else { return false; } } catch (Exception ex) { return false; } } The error handling here is pretty sparse (OK, really it s nonexistent) but it works fine. If there are no tasks for the current document, an error will be thrown in one of the SelectSingleNode statements, and our catch statement will grab it and just return false. You can add whatever more robust error handling you need. Notice, too, that this method does double-duty. Not only does it populate the variables we need with the task information, it also returns a Boolean value so we know whether or not to show the task pane.
Paint USS Code 128 In VS .NET
Using Barcode printer for ASP.NET Control to generate, create Code 128B image in ASP.NET applications.
www.OnBarcode.com
Barcode Creator In Visual Basic .NET
Using Barcode generator for .NET Control to generate, create Barcode image in VS .NET applications.
www.OnBarcode.com
CHAPTER 9 A WORKFLOW SMORGASBORD
Barcode Reader In Visual Studio .NET
Using Barcode reader for .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
Data Matrix Generator In Objective-C
Using Barcode creator for iPhone Control to generate, create DataMatrix image in iPhone applications.
www.OnBarcode.com
If we got valid values from the GetValuesFromXML method, the last thing we need to do is show the task pane with the workflow task information. While this can certainly be made nicer looking by using user controls and the visual design environment in Visual Studio, my main goal here is to highlight the functionality, so we re just going to create a very rudimentary task pane. You can gussy up your task pane any way you need to when you re building your production system. For now, the code in Listing 9-9 does the trick. It creates a button and a label, and creates an event handler for the button to launch a browser and open the task form for the workflow task. That s all we need for now. Listing 9-9. Our Task Pane private void ShowTaskPane() { Label lblTaskName = new Label(); lblTaskName.Text = sTaskName; Button btn = new Button(); btn.BackColor = Color.Silver; btn.Text = "View Workflow Task"; btn.Click += new System.EventHandler(btn_Click); this.ActionsPane.Controls.Add(lblTaskName); this.ActionsPane.Controls.Add(btn); } private void btn_Click(object sender, System.EventArgs e) { System.Diagnostics.Process.Start(sTaskURL); } That s all there is for this step. Go ahead and compile your solution.
UPC-A Supplement 2 Maker In None
Using Barcode printer for Software Control to generate, create Universal Product Code version A image in Software applications.
www.OnBarcode.com
Make Code 3 Of 9 In C#
Using Barcode printer for VS .NET Control to generate, create Code 39 Extended image in VS .NET applications.
www.OnBarcode.com
Making Data Matrix In Objective-C
Using Barcode printer for iPad Control to generate, create ECC200 image in iPad applications.
www.OnBarcode.com
Create EAN 13 In Objective-C
Using Barcode drawer for iPhone Control to generate, create EAN / UCC - 13 image in iPhone applications.
www.OnBarcode.com
DataMatrix Creator In None
Using Barcode generation for Office Excel Control to generate, create DataMatrix image in Office Excel applications.
www.OnBarcode.com
Paint UPC Symbol In Java
Using Barcode printer for Android Control to generate, create GTIN - 12 image in Android applications.
www.OnBarcode.com
Copyright © OnBarcode.com . All rights reserved.