我们有一个工作流作为webservice应用程序。我们为每种工作流程类型使用自定义跟踪配置文件。
工作流程程序集版本已更改,因此我也更改了配置文件版本。因此,旧的工作流程应该可以正常工作。
现在我启动了工作流运行时,工作流被触发并持久保存到DB 一段时间后,我重新启动运行时,工作流程被重新补充,但尝试在工作流程上调用事件,它显示异常。
如果未重新启动工作流引擎,一切正常,没有错误和工作流程完成。
System.Workflow.Activities.EventDeliveryFailedException: Event "Event_111" on interface type "Service.IService" for instance id "4d0b7397-4ce1-49c7-92c6-92405caa8fe4" cannot be delivered. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: profile
at System.Workflow.Runtime.RTTrackingProfile..ctor(TrackingProfile profile, Activity root, Type serviceType)
at System.Workflow.Runtime.TrackingProfileManager.CreateProfile(TrackingProfile profile, Type workflowType, Type serviceType)
at System.Workflow.Runtime.TrackingProfileManager.GetProfile(TrackingService service, Activity workflow, Version versionId)
at System.Workflow.Runtime.TrackingListenerFactory.GetChannels(Activity schedule, WorkflowExecutor exec, Guid instanceID, Type workflowType, TrackingListenerBroker& broker)
at System.Workflow.Runtime.TrackingListenerFactory.GetListener(Activity sked, WorkflowExecutor skedExec, TrackingListenerBroker broker)
at System.Workflow.Runtime.TrackingListenerFactory.GetTrackingListener(Activity sked, WorkflowExecutor skedExec, TrackingListenerBroker broker)
at System.Workflow.Runtime.TrackingListenerFactory.WorkflowExecutorInitializing(Object sender, WorkflowExecutorInitializingEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at System.Workflow.Runtime.WorkflowRuntime.WorkflowExecutorCreated(WorkflowExecutor workflowExecutor, Boolean loaded)
at System.Workflow.Runtime.WorkflowExecutor.ReRegisterWithRuntime(WorkflowRuntime workflowRuntime)
at System.Workflow.Runtime.WorkflowRuntime.RegisterExecutor(Boolean isActivation, WorkflowExecutor executor)
at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)
at System.Workflow.Runtime.WorkflowRuntime.GetWorkflow(Guid instanceId)
at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)
--- End of inner exception stack trace ---
at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)
at RecipeChangeService.RecipeChangeService.MfgEngOrTLApproved(Guid instanceId, ResponseDataObject rdo) in E:\MES\trunk\DotNet\WorkflowDesignProject\WorkflowDesignProject\Workflow Types\RecipeChangeWF\RecipeChangeService.cs:line 64
任何想法,出了什么问题?有两个不同版本的工作流程,但附加到相同的配置文件版本,这可能是问题吗?
答案 0 :(得分:1)
我找到了解决方案。在创建跟踪配置文件xml时,跟踪配置文件的版本应与版本匹配。
TrackingProfile myProfile = new TrackingProfile();
myProfile.Version = new Version("4.0.0.0");
版本应与存储过程“UpdateTrackingProfile”中使用的版本相同 这解决了我的问题。