Marshall,
For our login activity, we created a property on the main workflow and set the user ID there, and then access it from our sub activities like this:
Code in MainWorkflow:
Private _ActiveUser As Nullable(Of DAL.User)
Public Property ActiveUser() As Nullable(Of DAL.User)
Get
Return _ActiveUser
End Get
Set(ByVal value As Nullable(Of DAL.User))
_ActiveUser = value
End Set
End Property
Code in Subworkflow:
Dim parentWorkflow As MainWorkflow = Nothing
parentWorkflow = CType(Me.Workflow, MainWorkflow)
parentWorkflow.ActiveUser = newUser
We first off create the variable for parentWorkflow and set it to nothing, then in a later sub procedure we set it to the main workflow with the second line of code. Then when we finally build the user object, we set the ActiveUser object which is on the MainWorkflow to newUser. We can then access the user information anywhere in our application like this:
Code in SubActivity:
Private parentWorkflow As MainWorkflow = Nothing
parentWorkflow = CType(Me.Workflow, MainWorkflow)
dim UserID as Integer = Me.parentWorkflow.ActiveUser.Value.UserID
Hope this helps.