We have an application where we are creating an activity (say = CallA), this activity will be used in the worklfow project. This activity(CallA) will call a method which is present in another class(and another namespace). I have written a sample code for the method being called below :-
namespace WorkflowApplication1
{
class Class1
{
public int Trial(int a, int b)
{
return 23;
}
}
}
We want to use InvokeMethod feature provided in the toolbox and don't want to use codeactivity.
If anybody has used this feature of WF 4.0, please help.
Thanks in advance.
In the target type you have to point to the class that implements the method.
In the method name you'll have to write the name. If the method is not static, then you'll need to create a variable of that class type, initialize it in advance and use it in the TargetObject property. You'll need a variable in your WF to store the result (using Result property on the Invoke activity)
Hope it helps