使用 XAML 动态创建 WWF 工作流程X:名称无效
我正在创建一个自定义工作流程活动,这些活动有一个基类,如下所示
public class BaseClass : SequenceActivity
{ }
public class Activity1 : BaseClass
{ }
public class Activity2 : BaseClass
{ }
然后我编写工作流程的 xoml,如下所示
<GS1:Activity1 x:Name="Activity2"></GS1:Activity1>
<GS1:Activity2 x:Name="Activity3"></GS1:Activity2>
一切正常,直到我想启动工作流程
workflowRuntime.CreateWorkflow(Type.GetType("WorkflowType Full Name"), null, Guid.NewGuid());
我收到以下错误
error 1538: Activity 'BaseClass' validation failed: There is already an activity named 'BaseClass'. Activity names must be unique.
请注意,上面的工作正常在WF3.5上,当我升级到WF4.0时出现这个错误。
非常感谢任何帮助。
I am creating a custom workflow activities, these activities have a base class as shown below
public class BaseClass : SequenceActivity
{ }
public class Activity1 : BaseClass
{ }
public class Activity2 : BaseClass
{ }
Then I write the xoml of the workflow as shown below
<GS1:Activity1 x:Name="Activity2"></GS1:Activity1>
<GS1:Activity2 x:Name="Activity3"></GS1:Activity2>
everything works fine until i want to start the workflow
workflowRuntime.CreateWorkflow(Type.GetType("WorkflowType Full Name"), null, Guid.NewGuid());
I get the below error
error 1538: Activity 'BaseClass' validation failed: There is already an activity named 'BaseClass'. Activity names must be unique.
Note that the above was working correctly on WF3.5, this error appeared when I upgraded to WF4.0.
Any help is very appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您在这里合并了 WF3 和 WF4 类。这有点令人困惑,因为它们很相似并且都有一个 Activity 类,但没有关系。 WorkflowRuntime 是 WF3 类型。通过 WF4,您可以使用 WorkflowApplication 或 WorkflowInvoker 来运行工作流。
It looks like you are combining WF3 and WF4 classes here. It is a bit confusing because they are similar and both have an Activity class but there is no relation. The WorkflowRuntime is a WF3 type. With WF4 you can use the WorkflowApplication or the WorkflowInvoker to run a workflow.