Geeks With Blogs
Paul Chapman .Net Musings

The form I need to model with Workflow is split into sections. Depending on what section it will be filled in by anyone of three different groups of people. However at the moment I am trying to deal with the communication between the host application and the workflow itself.

First part of that is to define the Arguments that will be passed to our Event

 

Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Text
Imports System.Workflow.Activities
Imports System.Workflow.ComponentModel

Namespace FormularyWorkflow

     <Serializable> _ 
     Public Class SectionA_ApplicantEventArgs
          Inherits ExternalDataEventArgs
          Dim _Applicant As
String
          Dim _Email As
String
          Dim _ApplicationDate As Date = Date.Now
          Dim _Signed As Boolean =
False
     

          Public Sub New(ByVal InstanceId As Guid)
               MyBase.New(InstanceId)
          End Sub

          Public Property Applicant() As String
              
Get
                    Return _Applicant
               End Get

               Set(ByVal value As String)
                   
_Applicant = value
              
End Set

          End Property

          Public Property Email() As String
               Get
                    Return _Email
               End Get

               Set(ByVal value As String)
                    _Email = value
               End Set
          End Property

          Public Property ApplicationDate() As Date
              
Get
                   
Return _ApplicationDate
              
End Get

               Set(ByVal value As Date)
                   
_ApplicationDate = value
              
End Set
          End Property

          Public Property Signed() As Boolean
              
Get
                   
Return _Signed
              
End Get

               Set(ByVal value As Boolean)
                   
_Signed = value
              
End Set
          End Property
     End Class
End Namespace

There is not much to say about this bit of code. First we import the workflow namespaces; Workflow.Activities and Workflow.ComponentModel. Our class inherits from ExternalDataEventArgs. Finally we define a constructor for the class which simple calls the base class constructor with an indentifier for the workflow.

To define the way that our workflow exchanges data we now create the actual interface.

Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Text
Imports System.Workflow.Activities
Imports System.Workflow.ComponentModel

Namespace FormularyWorkflow

     <ExternalDataExchange> _

     Public Interface IFormularyDataExchange
         
Event ApplicationEventHandler As EventHandler(Of SectionA_ApplicantEventArgs)
     End
Interface
End
NameSpace
Posted on Thursday, July 3, 2008 10:30 PM Windows Workflow Foundation | Back to top


Comments on this post: A first attempt with Windows Workflow Foundation #2

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © paulschapman | Powered by: GeeksWithBlogs.net