Windows Workflow Foundation 3
data exchange between workflow activities
Is there a way to exchange data between two activities? I have a need where multiple activities would be executed in sequence on same data, (calling multiple function on same object).e.g. I have a sequence activty having Custom activity A, B and C. When Sequence starts execution, can i exchange data from activity A to activity B to C? Activity A would be closed and then it will transfer data to B and same from B to C. In my custom Activity, I am calling a method to process data, Any suggestion which activity type should i use? Thanks, Hiten
Absolutely. One way would be to bind properties from the Activities. Activity B could bind to a property of Activity A which is set before Activity A completes executing, etc... If you are using CallExternalMethod activity to call a method that interacts with the host application then you could do it a couple of ways. If your method that processes the data has a return value, then you could bind to that and not need to build a custom activity. If you merely need to call a method from a code library, then you could build a custom activity that derives from Activity and make your calls in the Execute override. Does this information help? Please provide back with more details of your scenario and I can provide a sample for you. Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.
Absolutely. One way would be to bind properties from the Activities. Activity B could bind to a property of Activity A which is set before Activity A completes executing, etc... If you are using CallExternalMethod activity to call a method that interacts with the host application then you could do it a couple of ways. If your method that processes the data has a return value, then you could bind to that and not need to build a custom activity. If you merely need to call a method from a code library, then you could build a custom activity that derives from Activity and make your calls in the Execute override. Does this information help? Please provide back with more details of your scenario and I can provide a sample for you. Steve Danielson [Microsoft]This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for the reply. If possible, could you give me a sample for this Or do you know any sample that uses this approach? I am using code activity for my sample, but I did't find any sample having a way to bind property to another activity. Thanks, Hiten
Steve, Sorry for incomplete question, the scenario is , I have a dataset with multiple rows in it. I would be processing one row each at a time and the processing would be multiple activities on same row. e.g. activity A would change value of a field in row based on some database driven rule, Activity B could update the row with value from other object etc. etc. Since I want to perform multiple activities on each row, it would be a sequence of operation on same record. After processing all activities, I would be moving to next row. At the end of processing all rows, i want to return dataset to next activity Or call other workflow (this could be an activity) to start processing on this dataset. Also, If possible, I want to monitor each activity such that I can see on workflow monitor whats going on on each steps and where the workflow stands. There is a human interaction as well, which would come in to picture after processing is done by other workflow (which could be an activity). Any suggestion? or code sample? FYI, I am using ForEach activity at present to go through each records and I have typed datasets across my system. Thanks a ton for all your help
Related Links
WorkFlow - timer
EnqueueItem for transactional delivery of data
WorkFlowRuntime with events (ASp.Net)
Workflow on the fly
Windows Workflow and ASP.Net
State Machine "Undo" to previous state
Bind workflow property to a read-only activity property
Developing an application for a service support provider.
WorkflowRuntime.CreateWorkflow Performance
Access sequential workflow dependency property from custom activity
Access to workflow queues from external processes
Persiste in a custom activity
Workflow re-activates on Final State when using OnWorkflowItemChanged Event
Windows WorkFlow Foundation: Cannot add a new state in between two existing states.
Within VS2008, can't drill down into a workflow without checking it out
SQLTrackingService tracks incorrect WorkflowInstanceEvent order?