【问题标题】:Workflow Foundation 4 Management without using AppFabric不使用 AppFabric 的 Workflow Foundation 4 管理
【发布时间】:2012-01-25 18:34:40
【问题描述】:

我们有一个 WF4 工作流,其中包含作为 WCF 服务的一系列活动。

CalculateTaxesActivity
创建订单活动
信用卡授权活动
等等……

我们的管理员正在使用 AppFabric 对其进行管理,并在需要时恢复、取消、终止工作流程。但是我们需要将管理任务委派给仓库,我们不想让他们访问运行 AppFabric 的服务器来执行此操作。

有没有办法通过使用框架中可用的 API 或类来管理工作流?如果其中任何一个出现故障等,我们希望仓库人员跟踪和恢复工作流程......

【问题讨论】:

    标签: wcf workflow workflow-foundation workflow-foundation-4 appfabric


    【解决方案1】:

    在大多数情况下,AppFabric UI 不直接与工作流或 WorkflowServiceHost 通信,而是使用 WorkflowControlEndpointWorkflowControlClient 来执行此操作。如果你愿意,你可以从你的代码中做同样的事情。

    默认情况下,WorkflowControlEndpoint 使用 NetNamedPipeBinding 公开自己,因此如果您想接受来自另一台机器的请求,则需要更改它。

    WorkflowServiceHost 配置:

    <service name="MyWorkflow“
             behaviorConfiguration="MyWorkflowBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8080/MyWorkflow" />
        </baseAddresses>
      </host>
      <endpoint address="" 
                binding="basicHttpBinding" 
                contract="IMyWorkflow" />
      <endpoint kind="workflowControlEndpoint" 
                address="Control" 
                binding="basicHttpBinding" />
    </service>
    

    客户端代码:

    var instanceId = <<an existing workflow instanceId>>;
    
    var controlBinding = new BasicHttpBinding();
    var controlAddress = 
        new EndpointAddress("http://localhost:8080/MyWorkflow/Control");
    
    var proxy = new WorkflowControlClient(controlBinding, controlAddress);
    
    proxy.Suspend(instanceId);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多