How can i call a methode from a workflow with parameters?

Hello!

I would like to call a method from within a workflow. I have defined a Methode in the Interface and I would like to pass a parameter, say some value defined in my xoml.cs file. To test this, I am using the base.WorkflowInstanceId Property.
1) do I have to define the Parameter Binding in the xoml file or in the xoml.cs? How is the Syntax of Binding Properties to the CallExternalMethodActivity?
The definition of my call is now:
<CallExternalMethodActivity x:Name="requestName" InterfaceType="{x:Type p4:IGetNameService,TypeName=Workflow.RuntimeServices.IGetNameService}" MethodName="RequestName" xmlns:p4="clr-namespace:Workflow.RuntimeServices;Assembly=Workflow.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c4620ae819b5257e"/>

Thanks in advance
Josef

[841 byte] By [thezepp] at [2007-12-22]
# 1

It looks like this in the .xoml file. You have to make sure though that your workflow type has the Path attribute value as a public field or property.

<CallExternalMethodActivity x:Name="callExternalMethodActivity1" InterfaceType="{x:Type WorkflowConsoleApplication3.IComm}" MethodName="Method">

<CallExternalMethodActivity.ParameterBindings>

<WorkflowParameterBinding ParameterName="p1">

<WorkflowParameterBinding.Value>

<ActivityBind Name="Workflow2" Path="_p1" />

</WorkflowParameterBinding.Value>

</WorkflowParameterBinding>

<WorkflowParameterBinding ParameterName="p2">

<WorkflowParameterBinding.Value>

<ActivityBind Name="Workflow2" Path="_p2" />

</WorkflowParameterBinding.Value>

</WorkflowParameterBinding>

</CallExternalMethodActivity.ParameterBindings>

</CallExternalMethodActivity>

JonFlanders at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2
Thank you very much! It works now.
josef
thezepp at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified