0
votes

Got a simple "Newbie" kind of a question.

I would like to "share" an InArgument between 2 Workflows. Let's consider for a moment the following classic OOP scenario, you got 2 classes with the same property, a reasonable OOP approach would be to create a base class and implement this property once.

When you create a new WorkFlow project, you got a xaml file and your cs is auto-generated. I would like to be able to inherited from an activity that will specify that InArgument and make the WorkFlow show it's property in it's Argument designer. With this approach I should be able to define an InArgument once in an activity and enforce derived WF to have this argument.

Does it make sense?

Consider that this suppose to be part of a framework, I would like my framework user to do the minimum and I still wish him to be able to use a deisgner (using only CodeActivities is unreasonable).

How can I accomplish it?

Ariel

2
Why is the question unclear? instead of marking it down, explain to me what need to be clearer. - ArielBH

2 Answers

0
votes

FYI, In WF4 the VS2010 WF designer only generates XML. There is no generated C# code.

What you want to do is develop a custom Activity in code which exposes the InArgument as a property. Your custom activity will appear in the Toolbox and can be used in any workflow that you design.

0
votes

FYI, A Reply from WP4 Forum in MSDN:

WF4 workflow is not a OOP language, and I don't think that it is a good idea to inherit a existed workflow. As a an alternative solution. you can create a composte activity as a workflow template. then users can create their own workflow by using your workflow template.

http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/08b8e00d-8363-4858-8377-83373213edae#fb352215-da10-4c77-8782-d047519f0e08