rahul1782


Hi

I am using Workflow to model the flow of material through a supply chain. For this I have created:

1. A custom activity
2. A custom state - that will include this activity

Depending on whether I am going up the chain or down , I need to transition from the ith custom state to either the i+1th custom state or i-1th state and while doing this I need to carry information from the custom activity (of the ith state) to the next state while making the state transition.

Does anybody know of any way in which I can manipulate the SetState Activity to carry information forward \ suggest any alternate way of doing this

Thanks

Rahul




Re: Custom Activity - Custom State Interaction

ElifOn - MSFT


Hi Rahul,

Did you take a look at the following sample : http://msdn2.microsoft.com/en-us/library/ms741709.aspx

Some other possible solutions that came to my mind :

You can have your workflow to have a global property on which you can set the values, if you dont want your workflow to have a property then try the following:

You can have an attached dependency property on the receive activity that will be attached on the workflow and you may be able to pass the values like that. When it is set on the activity, it will actually be set on the workflow.

You can hold it in your host, and everytime you can get the value from the host, set it and send the value back to host.

If none of these work for you let me know and i can try to come up with more solutions

Elif






Re: Custom Activity - Custom State Interaction

rahul1782

Hi Elif,

Thanks for the response. Do you have any more context on the dependency property option that you mentioned (sample, blog) - I think that might suit my model the best.

Thanks

Rahul







Re: Custom Activity - Custom State Interaction

ElifOn - MSFT

Hi Rahul,

Here is some read on it:

http://msdn2.microsoft.com/en-us/library/system.workflow.componentmodel.dependencyproperty.registerattached.aspx

http://msdn2.microsoft.com/en-us/library/system.workflow.componentmodel.dependencyproperty.aspx

I believe when you use the RegisterAttached method you wont have trouble in passing the value over since the owning activity will nto be the custom activity for that property.

I currently could not find a sample among our sdk samples however i will keep lookin in the netfx3 site and let you know of the sample applications that use regfisterattached.

Hope this works

Elif






Re: Custom Activity - Custom State Interaction

Tom Lake - MSFT

There is a sample of a custom set state activity on the post at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1375501&SiteID=1.





databaseforum