How to give input parameters to workflow? And what about deactivation?
Hey guys,
I'm trying to figure out how I can initialize a workflow with parameters so that e.g. CallExternalMethodActivity can pass values to other methods. The RaiseEventToLoadWorkflow example I guess was supposed to use that kind of parameters for DocumentID and ApprovedBy but unelegantly "solves" the problem by blatantly ignoring it.
The other question is, what happens upon deactivation of an idle workflow. Will these parameters and results of other activities get de/serialized when I save and load a workflow?
Thanks, Christoph
Hi people!
Christoph: You can pass parameters to a workflow instance, at creation time:
Dim pars as new Dictionary(Of String, Object)
pars.Add("Name","Joe Dow")
wi = workflowRuntime.CreateWorkflow(GetType(MyGreatWorkflow),pars)
You can pass a IDictionary implementation. Then, the name of the parameters must be the name of properties in your workflow class.
Partial Class MyGreatWorkflow
Inherits SequentialWorkflowActivity
Public Property Name as String
.....
Angel "Java" Lopez
Hi Christoph,
You can pass parameters to a workflow as Angel describes above.
As for your question with regards to workflow state on unload/load, the answer it "yes." All of your workflow state, including the parameters, will be serialized and thus retain their value upon loading.
Thanks,
Angel