CallExternalMethodActivity parameterbinding

I need some help with CallExternalMethodActivity... How do i pass parameters to the external method? Is it done using parameterbinding? Or is it through DependencyProperty? If it is done using parameterbinding, then, how? Lets say, in the below code

IOperations represents the custom interface which will be used by CallExternalMethodActivity and the method name used will be ExecuteOperation. Now, this method takes a parameter of type ICustomParams. CustomParams implements ICustomParams & it will be used in externaldataexcahnge service and it already inherits ExternalDataEventArgs

The question is how do i pass data to this parameter.
    public class CustomParams : ExternalDataEventArgs, ICustomParams
        Hashtable m_ht;

    public class COperations : IOperation
        #region IOperation Members

        public event EventHandler<CustomParams> HandleOperation
                InternalOperation += value;
                InternalOperation -= value;
        public object ExecuteOperation(ICustomParams oParams)

        public void TriggerEvent(object sender, Params p)
            InternalOperation(sender, p);
        private event EventHandler<CustomParams> InternalOperation;

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IOperation operation = new COperations();
ICustomParams params = new CustomParams();

Why you can't do this?
bvRocksAuthor Commented:
The question is specific to Windows Workflow foundation's CallExternalMethodActivity usage. The call to ExecuteOperation comes via the WF framework. However the CallExternalMethodActivity activity does not have any method or a way to specify the parameter contents at runtime or compiletime for that matter.

I understand that when we want to use ActivityBind, we need to have a property in the workflow class corresponding to the bind information provided. However since my workdlows are dynamically generated, i dont want to do such a thing.
Ah, I see. Sorry, can't help you with this issue - never used WWF.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Bob LearnedCommented:
First, I am still learning WWF, and I am not a WWF champion, so this might be a work-in-progress.

The CallExternalMethodActivity class has the ParameterBindings property which is a WorkflowParameterBindingCollection type.

I believe that you should find an answer here:

Host Communication Sample

...and, here is a CodeProject article that talks about WWF:

Using Workflow Foundation and Visual Studio 2008 for Testing Automation

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bvRocksAuthor Commented:
Yes. But the problem as i mentioned in the previous post is, that the parameterbinding requires us to use ActivityBind class which in turn mandates us to use a member variable in the workflow, which is a problem. If we do that, i have to declare a unique member variable in the class for every activity. Alternatively, if i share one membervariable of the class amongst activities, how do i store the parameter information of the external call in each activity?
bvRocksAuthor Commented:
The code project link is good. Will revert after going thro the code in depth. Thanks.
Bob LearnedCommented:
I believe that the MSDN reference for the CallExternalMethodActivity.ParameterBindings method gives us a clue:


It looks like you need to create an instance of a WorkflowParameterBinding, and add it to the ParameterBindings collection.
bvRocksAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.