View Single Post
Old 07-02-2007   #1 (permalink)
MobileMan
Guest


 

WF Control Serialization issue ....

Sorry if this is the wrong place to post a .NET v3.0 Windows Workflow
question, but didn't find any other groups that seem to target this, so here
it goes .......

I have a WF that is encapsulated in Assembly "B". I also have my WF host
(which create thw WorkflowRuntime object) inside a Forms app in Assembly "A".
I'm attempting to pass a TextBox control from my form into the WF instance
(I do this using the standard Dictionary<String, Object> parms object
parameter of the workflowRuntime.CreateWorkflow() method

....... this.instance = workflowRuntime.CreateWorkflow(typeof(B.Workflow1));
......

Additionally, runtime uses the "SqlWorkflowPersistenceService" as a plug in
database persistance service. My problem comes when I unload my instance and
persist it to the DB. The TextBox I passed in isn't a serializable object,
and thus I get an exception that says we can't store this instance in the DB
because of this little fact. I get around this by decorating the TextBox
field with the [NonSerializable] attribute so that the persistence service
won't try to "save" the TextBox control in the database. But, the problem is
when I load the instance from the DB back into the runtime my TextBox control
is now NULL.

My question is how can I take my workflow instance and access the TextBox
reference from my forms app? Or, somehow "serialize" the TextBox control so
that it can be stored within the DB.

Open to suggestions. Thanks.
--
Stay Mobile
My System SpecsSystem Spec