WF实例历史记录计数保持为0,WCF历史记录确实更新 [英] WF instance history count remains at 0, WCF history does update

查看:87
本文介绍了WF实例历史记录计数保持为0,WCF历史记录确实更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

 

我正在尝试使用WF4和Windows Server App Fabric。主要原因是App Fabric附带的"免费"监控。我们当前的WF 3.5解决方案没有足够的工具。

我们的系统工作方式是它提供单一的"通用"WCF Web服务,并根据各种输入值确定需要哪种订单和然后我们开始正确的工作流程。对于我的实验,我使用WCF项目和
a 单独的活动库项目来完成工作,该项目包含工作流程。当在WCF服务上收到订单时,它会查找正确的XAML工作流,创建一个新实例并使用WorkflowApplication类运行它。

I am experimenting a little with WF4 and Windows Server App Fabric. The main reason is the 'free' monitoring that comes with App Fabric. Our current WF 3.5 solution is without adequate tooling.
The way our system works is that it offers a single 'generic' WCF web service and based on various input values we determine what kind of order is required and then we start the correct workflow. For my experiment I got this working using a WCF project and a separate Activity library project that houses the workflows. When an order is received at the WCF service, it look up the correct XAML workflow, creates a new instance and runs it using the WorkflowApplication class.

所有东西都托管在IIS中,所以从什么我已阅读到现在,这意味着我们应该获得完整的App Fabric支持。问题是,我可以看到WCF呼叫历史记录计数器正在更新,但WF实例历史记录计数器保持为0.我希望
在我调用Web服务几次并运行一些之后,其中一些增加了工作流程。

Everything is hosted in IIS, so from what I have read up until now, this means we should get full App Fabric support. The problem is that I can see the WCF Call History counters being updated, but the WF Instance History counters remain 0. I would expect some of them increasing after I called the web service a few times and had it run a few workflows.

当我从上下文菜单配置WCF和WF服务时,我启用了监控(在Health Monitoring中设置了级别)。工作流持久性设置为"自定义或无"。 (我在安装App Fabric期间设置它,所以我认为它使用全局设置。
无论如何,我还没有使用持久性)。工作流程主机管理已启用所有三个选项。其余配置选项似乎与WF内容无关。

When I configure the WCF and WF services from the context menu I have enabled monitoring (level is set at Health Monitoring). Workflow Persistence is set to "Custom or none" (I set it during the install of App Fabric, so I figure it uses a global setting. In any case, I'm not using persistence just yet). Workflow Host Management has all three options enabled. The rest of the configuration options don't seem related to WF stuff.

 

那么我做错了什么?

推荐答案

您好,

AppFabric监控在IIS中运行的工作流服务(* .xamlx)。如果在WCf服务中加载了工作流xaml,AppFabric认为它是WCF服务的一部分,因此您只获得WCF事件。要在WCF服务的上下文中获取WF应用程序事件,您需要按照以下步骤操作
。请注意,这只会有效,因为您有一个加载xaml的服务,而不是在服务外部运行的松散xaml工作流。

AppFabric monitors Workflow Service (*.xamlx) running in IIS. If a workflow xaml is loaded in a WCf service AppFabric thinks it is a part of the WCF service, so you get only the WCF events. To get WF application events in context of WCF service you will need to follow some steps below. Note this will only work since you have a service that loads the xaml, not for loose xaml workflows that run on outside a service..

您可以在工作流应用程序上添加ETW跟踪参与者获取跟踪事件。由于您使用的是xaml,因此您需要在代码中添加跟踪参与者和跟踪配置文件,并在
主机参考字段中设置运行WCF服务的虚拟路径。

You can add the ETW tracking participant on the workflow application to get tracking events. Since you are using xaml you will need to add the tracking participant and tracking profile in code as well as set the virtual path where the WCF service runs in the host Reference field.

步骤

1)创建ETWTrackingParticipant( EtwTrackingParticipant

1) Create ETWTrackingParticipant(EtwTrackingParticipant)

2)将applicationReference设置为工作流在

2) Set applicationReference to the virtual path of the service that the workflow executes in

3)为跟踪参与者设置跟踪配置文件。

3) set the tracking profile for the tracking participant.

4)将上面创建的跟踪参与者添加为您创建的workflowApplication类的扩展(workflowApplication.extensions。 add(< traackingParticpant,已创建能够>)

4) Add the tracking participant created above as an extension to the workflowApplication class that you create (workflowApplication.extensions.add(<traackingParticpant that was created able>)

5)运行服务调用执行工作流程的操作

5) Run the service invoking the operation that executes the workflow

此代码在WCF服务

// HostReference格式

// HostReference Format

 

 

//< SiteName>< ApplicationVirtualPath> |< ServiceVirtualPath> |< ServiceName>

//至少需要SiteName和ApplicationVirtualPath

 

 

string
applicationReference =
string 。格式( " {0} {1}"
HostingEnvironment .SiteName ,
主机环境 。ApplicationVirtualPath);

string applicationReference = string.Format("{0}{1}", HostingEnvironment.SiteName, HostingEnvironment.ApplicationVirtualPath);

 

 

WorkflowApplication
app =
new
WorkflowApplication
工作流1 ());

WorkflowApplication app = new WorkflowApplication(new Workflow1());

 

 

EtwTrackingParticipant
etwTracking =
new
EtwTrackingParticipant ();
//可以添加跟踪配置文件以获取特定事件

EtwTrackingParticipant etwTracking = new EtwTrackingParticipant(); //A tracking profile can be added to get specific events

etwTracking.ApplicationReference = applicationReference;

etwTracking.ApplicationReference = applicationReference;

app.Extensions.Add(etwTracking);

app.Extensions.Add(etwTracking);

app.Run();

app.Run();

谢谢,

- 维克拉姆


这篇关于WF实例历史记录计数保持为0,WCF历史记录确实更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆