Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Store Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems.

Go Back   Vista Forums > Vista technology newsgroups > WinFX General

WF Control Serialization issue ....

Reply
 
Thread Tools Display Modes
Old 07-02-2007   #1 (permalink)
MobileMan
Guest
 
Posts: n/a

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
  Reply With Quote

Old 07-02-2007   #2 (permalink)
MobileMan
Guest
 
Posts: n/a

RE: WF Control Serialization issue ....

Oooppss - code example error:

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

Okay, forgot the params dictionary parameter that get's passed in witth the
Type of workflow we want to get an instance of.

Thanks.
--
Stay Mobile


"MobileMan" wrote:

> 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

  Reply With Quote
 
Reply

Thread Tools
Display Modes









Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46