WorkflowApplication.Load 方法的问题

Problems with WorkflowApplication.Load method

提问人:Pestrea Radu-Constantin 提问时间:10/11/2023 更新时间:10/11/2023 访问量:23

问:

我正在尝试调试System.Activities.WorkflowApplication的错误。这是我的代码。

var instanceStore = SetupSqlpersistenceStore();
var workflowApplicationInstance = WorkflowApplication.GetInstance(workflowInstance.WorkflowInstanceGuid.Value, instanceStore);
var wf = WorkflowFactory.GetInstance((WorkflowTypes) workflow.WorkflowTypeId, workflowApplicationInstance.DefinitionIdentity);                
var wa = new WorkflowApplication(wf, workflowApplicationInstance.DefinitionIdentity);

wa.Extensions.Add(GetSqlTracker(databasename));
wa.InstanceStore = instanceStore;
int count = 0;
wa.PersistableIdle = (e) =>
                {
                    //persists application state and remove it from memory 
                    if (count > 0)
                        return PersistableIdleAction.Unload;
                    count++;
                    return PersistableIdleAction.None;
                };

wa.Unloaded = (workflowApplicationEventArgs) => waitHandler.Set();
wa.Load(workflowApplicationInstance);

在最后一行wa.Load(workflowApplicationInstance);

我收到以下错误。

“EnvironmentLocationReference Int32>”不是类型 'HbbManualActivity1'。1'. When loading this instance you must ensure that the activity with name 'EnvironmentLocationReference<Int32>' implements 'HbbManualActivity

我不知道EnvironmentLocationReference Int32>是什么意思。 HbbManualActivity 是一个声明如下的类,但我找不到在解决方案中使用它。

public class HbbManualActivity<T> : NativeActivity<T>

我试着改变wa。Load() 方法使用 InstanceID 而不是 wofklowApplicationInstance,但我收到一个不同的错误,说 InstanceStore 被锁定到一个所有者。

C# 工作流基础-4

评论


答: 暂无答案