简体   繁体   English

使用dynamicUpdateMap更新正在运行的工作流程

[英]Update Running workflow with dynamicUpdateMap

I have a workflow running and i'm trying to update it dynamically. 我有一个工作流程正在运行,我正在尝试动态更新它。 It is a Flowchart and i'm trying to change the Next property of a FlowStep. 这是流程图,我正在尝试更改FlowStep的Next属性。 The problem is that when loading WorkflowApplication.Load(workflowApplicationInstance, map); 问题是,在加载WorkflowApplication.Load(workflowApplicationInstance,map);时, the instance with the map, i got the error: 地图实例,我得到了错误:

In order for an implementation map to be directly applied to a workflow instance, the root of the definition must not have any public/imported children or public/imported delegates. 为了将实现映射直接应用于工作流实例,定义的根一定不能有任何公共/导入的子代或公共/导入的委托。

i tried saving the map to file and to database, because i saw in other examples, the map is saved with extension file.map not file.xaml of file.xml. 我尝试将地图保存到文件和数据库中,因为在其他示例中看到的是,地图以扩展名file.map而不是file.xml的file.xaml保存。 Anyway it was useless, it's still not loading. 无论如何,它是无用的,仍然没有加载。

Solved that. 解决了。 The problem was when calling PrepareForUpdate and CreateUpdateMap methods, from their API, i was calling them with ActivityBuilder parameter and it should have been Activity. 问题是从它们的API调用PrepareForUpdate和CreateUpdateMap方法时,我使用ActivityBuilder参数对其进行了调用,它应该是Activity。 So having the ActivityBuilder of a workflow you can obtain the activity of it like this: 因此,有了工作流的ActivityBuilder,您可以像这样获得它的活动:

ActivityBuilder workflowDefinition; ActivityBuilder工作流程定义; Activity flowcharWorkflow = workflowDefinition.Implementation as Flowchart(); 活动flowcharWorkflow = workflowDefinition.Implementation为Flowchart();

if your workflow definition has a root of flowchart. 如果您的工作流程定义具有流程图的根。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM