SlideShare a Scribd company logo
1 of 13
InfoPath Task Forms Made Easy Sense and Simplicity Florin Muntean Florin.Muntean@philips.com Level: 300
Agenda
What this presentation is:
Info Path Uses xsd files to define data types. Easy to create Form UI by drag and drop. Use a secondary data source to transfer data between Workflow Task extended properties and Info Path Task Forms. Case sensitive and impossible to debug the transfer. No Type Safety during transfer, everything is a string.
Demo 1 Info Path Form <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schematargetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-02-15T01:13:55"  xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-02-15T01:13:55"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 	<xsd:element name="myFields"> 		<xsd:complexType> 			<xsd:sequence> 				<xsd:element ref="my:Field1" minOccurs="0"/> 			</xsd:sequence> 			<xsd:anyAttributeprocessContents="lax" namespace="http://www.w3.org/XML/1998/namespace"/> 		</xsd:complexType> 	</xsd:element> 	<xsd:element name="Field1" type="xsd:string"/> </xsd:schema>
SharePoint Workflow Have full access to the InfoPath Form xml for the item that this workflow instance is attached. Have indirect access to the InfoPath Task Forms using Extended Properties Hard or impossible to pass arrays and complex data types.
1) Deserialize the current InfoPath Form  XmlSerializerserializer = new XmlSerializer(typeof(expenseReport));  using (Stream stream = this.workflowProperties.Item.File.OpenBinaryStream())  {       Expenses = serializer.Deserialize(stream) as expenseReport;  } 2) Pass the data to the task forms ApproveTaskProperties.ExtendedProperties["EmployeeName"] = Expenses.employee.name; ApproveTaskProperties.ExtendedProperties["ExpenseTotal"] = Expenses.items.total.Value.ToString();
Demo Keep data safety and access all Info Path Form data inside Workflow. XmlSerializerserializer = new XmlSerializer(typeof(expenseReport));  using (Stream stream = this.workflowProperties.Item.File.OpenBinaryStream())  {       Expenses = serializer.Deserialize(stream) as expenseReport;  } Show how to transfer data to a task and talk about limitations. ApproveTaskProperties.ExtendedProperties["EmployeeName"] = Expenses.employee.name; ApproveTaskProperties.ExtendedProperties["ExpenseTotal"] = Expenses.items.total.Value.ToString();
Introducing WorkflowIPTask.WSP Serialize the class generated from task xsd schema Pass one extended property to the InfoPath Form Services as Main Data Source.
Demo Pass the whole form data to the task and display complex types.
Conclusion Design the Forms with data in mind Create a common xsd to be used across the Item Form and Task Forms. Use another xsd as the principal for Item and Task Form. Generate the forms from the xsds Generate classes from the xsds Use single namespace for all forms generated classes Use serialization/de-serialization to  pass data.
Resources: InfoPath Team Blog:  http://blogs.msdn.com/infopath/ Microsoft SharePoint Team Blog: http://blogs.msdn.com/sharepoint
Thank you Florin Muntean Florin.Muntean@philips.com http://fmuntean.wordpress.com

More Related Content

Similar to Sense And Simplicity Info Path Task Forms Made Easy

02 a xml_foundations
02 a xml_foundations02 a xml_foundations
02 a xml_foundationsSalma Zaki
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web PerformanceAdam Lu
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsJudy Breedlove
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Introduction to Prototype JS Framework
Introduction to Prototype JS FrameworkIntroduction to Prototype JS Framework
Introduction to Prototype JS FrameworkMohd Imran
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRPeter Elst
 
Editing XML data with XForms
Editing XML data with XFormsEditing XML data with XForms
Editing XML data with XFormsstsire
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And XmlDavid Truxall
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XMLguest2556de
 

Similar to Sense And Simplicity Info Path Task Forms Made Easy (20)

02 a xml_foundations
02 a xml_foundations02 a xml_foundations
02 a xml_foundations
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Odp
OdpOdp
Odp
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Introduction to Prototype JS Framework
Introduction to Prototype JS FrameworkIntroduction to Prototype JS Framework
Introduction to Prototype JS Framework
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Editing XML data with XForms
Editing XML data with XFormsEditing XML data with XForms
Editing XML data with XForms
 
6 311 W
6 311 W6 311 W
6 311 W
 
test
testtest
test
 
6 311 W
6 311 W6 311 W
6 311 W
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XML
 
2310 b 12
2310 b 122310 b 12
2310 b 12
 

Sense And Simplicity Info Path Task Forms Made Easy

  • 1. InfoPath Task Forms Made Easy Sense and Simplicity Florin Muntean Florin.Muntean@philips.com Level: 300
  • 4. Info Path Uses xsd files to define data types. Easy to create Form UI by drag and drop. Use a secondary data source to transfer data between Workflow Task extended properties and Info Path Task Forms. Case sensitive and impossible to debug the transfer. No Type Safety during transfer, everything is a string.
  • 5. Demo 1 Info Path Form <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schematargetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-02-15T01:13:55" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-02-15T01:13:55" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="myFields"> <xsd:complexType> <xsd:sequence> <xsd:element ref="my:Field1" minOccurs="0"/> </xsd:sequence> <xsd:anyAttributeprocessContents="lax" namespace="http://www.w3.org/XML/1998/namespace"/> </xsd:complexType> </xsd:element> <xsd:element name="Field1" type="xsd:string"/> </xsd:schema>
  • 6. SharePoint Workflow Have full access to the InfoPath Form xml for the item that this workflow instance is attached. Have indirect access to the InfoPath Task Forms using Extended Properties Hard or impossible to pass arrays and complex data types.
  • 7. 1) Deserialize the current InfoPath Form XmlSerializerserializer = new XmlSerializer(typeof(expenseReport)); using (Stream stream = this.workflowProperties.Item.File.OpenBinaryStream()) { Expenses = serializer.Deserialize(stream) as expenseReport; } 2) Pass the data to the task forms ApproveTaskProperties.ExtendedProperties["EmployeeName"] = Expenses.employee.name; ApproveTaskProperties.ExtendedProperties["ExpenseTotal"] = Expenses.items.total.Value.ToString();
  • 8. Demo Keep data safety and access all Info Path Form data inside Workflow. XmlSerializerserializer = new XmlSerializer(typeof(expenseReport)); using (Stream stream = this.workflowProperties.Item.File.OpenBinaryStream()) { Expenses = serializer.Deserialize(stream) as expenseReport; } Show how to transfer data to a task and talk about limitations. ApproveTaskProperties.ExtendedProperties["EmployeeName"] = Expenses.employee.name; ApproveTaskProperties.ExtendedProperties["ExpenseTotal"] = Expenses.items.total.Value.ToString();
  • 9. Introducing WorkflowIPTask.WSP Serialize the class generated from task xsd schema Pass one extended property to the InfoPath Form Services as Main Data Source.
  • 10. Demo Pass the whole form data to the task and display complex types.
  • 11. Conclusion Design the Forms with data in mind Create a common xsd to be used across the Item Form and Task Forms. Use another xsd as the principal for Item and Task Form. Generate the forms from the xsds Generate classes from the xsds Use single namespace for all forms generated classes Use serialization/de-serialization to pass data.
  • 12. Resources: InfoPath Team Blog: http://blogs.msdn.com/infopath/ Microsoft SharePoint Team Blog: http://blogs.msdn.com/sharepoint
  • 13. Thank you Florin Muntean Florin.Muntean@philips.com http://fmuntean.wordpress.com

Editor's Notes

  1. Add Philips logo
  2. Show the xsd schema for one fieldShow the command to generate a class from it: xsd.exe ExpenseReportForm.xsd /c /namespace:MFD.Expenses.FormData
  3. Approval 1
  4. InfoPath forms are xml files.We can serialize a class as an xml and pass it to the extended properties.Why not use the same class that we generated from the task form?We use a special tag that we read and forcedly send it as the main data source to the task form.
  5. Approval 2
  6. &lt;xsd:import namespace=&quot;http://schemas.microsoft.com/office/infopath/2003/expXSD&quot; schemaLocation=&quot;ExpenseReport.xsd&quot;/&gt;Use single namespace for all