简体   繁体   English

wf4工作流程中的持久性活动失败

[英]Persist Activity fails in wf4 workflow

I am having a problem Persisting a workflow in wf4. 我在wf4中保持工作流时遇到问题。

I cannot persist the workflow using the Persist Activity. 我无法使用“持久性活动”持久化工作流程。 Nor can I persist the workflow from a method contained in a class I have injected into the workflow which I then call from inside the workflow using an InvokeMethod activity 我也不能通过注入到工作流中的类中的方法来持久化工作流,然后使用InvokeMethod活动从工作流内部调用该类

If I do: 如果我做:

workflowApp = new WorkflowApplication(new actBTX(), inParams);
workflowApp.Run();
workflowApp.Persist();    

in the factory method that creates the workflows then I can see the workflow persist. 在创建工作流程的工厂方法中,我可以看到工作流程仍然存在。

I have tested my workflows to see if I am in a NoPersistZone using: 我已经使用以下方法测试了工作流程,以查看我是否在NoPersistZone中:

        var prop = context.Properties.Find("System.Activities.NoPersistProperty");
        IsInNoPersistScope.Set(context, prop != null);

and it seems I am not. 看来我不是。

The fact that I can persist when I am 'outside' the workflow suggests to me that it is not a problem with the variable types that are in the workflow. 我可以在工作流“外面”时坚持不懈的事实向我表明,工作流中的变量类型不是问题。

When persistence fails it stops the whole workflow dead if I use the Persist activity. 当持久性失败时,如果我使用Persist活动,它将使整个工作流停止运行。 The method call throws an exception: 方法调用将引发异常:

 Exception: The operation did not complete within the allotted timeout of 00:02:00

Any ideas? 有任何想法吗?

Ok We worked it out. 好的,我们解决了。

There is a data object that doesn't serialise nicely. 有一个数据对象不能很好地序列化。 When Persist hits it it crashes silently (which is a bad thing). 当Persist命中时,它会默默崩溃(这是一件坏事)。

We suspect that workflowApp.Persist() works because the workflow is not fully initialized in the time between 我们怀疑工作流App.Persist()可以正常工作,因为工作流在两次之间的时间未完全初始化

workflowApp.Run();
workflowApp.Persist(); 

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

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