Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7808689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:12:18+00:00 2026-06-02T03:12:18+00:00

I have created a simple order manager wf service (state machine) in WF4. Order

  • 0

I have created a simple order manager wf service (state machine) in WF4.

simple state machine workflow

Order (EF entity) properties: Id, IsExport, NumOfProduct, ProductName, Status (waiting, approved, rejected).

State machine states:
1. OrderReceived (validation -> response activity)
2. Waiting (empty)
– Transitions:
update(update order activity) -> waiting state
approve(assign status field, update order and response activities) -> final state
3. Final state.

Correlation key: Order.Id

The implementation rised a few questions.

  1. WF can manage one flow of the order instance, the order flow and the order entity is in one-one relation.
    Question is that where and how should I implement the listing of entityes according to a state filter (eg. approved orders or waiting orders). The list should be accessible via WCF service method.

  2. What is the best practise to manage the batch data processing. (eg: Multiple order approval. “Foreach” in the client is not the required sln.)

  3. The state of the order is symbolized by the “state activity persisted instances” and the entity’s status field in the db as well.
    What is the best practise to decide the state of the entity, listing the active persisted activity instances in the defined state or select the entities from the db (by an activity) according to a state filter parameter?

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:12:21+00:00Added an answer on June 2, 2026 at 3:12 am

    Good questions!

    Taking your first and third questions, there are several possible approaches to this. All require that you write a custom WCF service to enumerate the required orders. This would probably not be a WF service; it might be a REST or OData service. How would you implement the service?

    1. You could do it entirely by querying your database through EF. This would have no dependency on WF at all, and is probably the easiest way. Your workflow would update the database record on each state change, and the service would only need to read that value.

    2. You could rely on the tracking mechanism provided by WF, and the extensions that Ron Jacobs refers to in his answer to your question. The tracking infrastructure is described here on MSDN. It is possible to use the tracking object in memory to get the state of active workflows. However, this probably won’t work well with IIS/WF services, which are automatically persisted and unloaded when dormant. You would be better off using the tracking facilities to write state records to a database. Your custom service would then just query this tracking database.

    Unless you want comprehensive information about the state changes and updates that have occurred through your WF service, suggestion number one should suffice.

    As for your second question, that is a little more complicated. Let’s say you write a REST service that lists the orders awaiting approval. You write a Web page that displays those orders, and the user can check the orders he wants to approve. Now, the number of workflows that you need to update is the same as the number of orders he approves.

    You could, as you mention, call the Web service multiple times—but for a large number of orders that would be an unnecessary overhead.

    What’s the alternative? You would need to write a custom service method on your non-WF service that takes an array of order ids. That service would have to call your WF service multiple times to update each one. Since the WF service is being called from another service on the same machine, you can use the .Net Named Pipe binding instead of one of the HTTP bindings so that the overhead is much less.

    It’s worth noting that Entity Framework doesn’t support batched updates either. You’d need to write a stored procedure or custom SQL if you wanted the database update to be batched too.

    Is all of this worth the effort? Probably! Using WCF and the named pipes binding is pretty standard with WF. You’ll need to configure Windows Activation Service for named pipes. Also, if you’re not already using AppFabric for Windows Server, have a look into it, because it adds some very good management tools for WF services.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple windows service that periodically checks a remote database via
I have created a WCF data service over a fairly simple EF 4.1 code
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file
I am new to Repository concept and get some questions. I have created simple
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and
i have created a simple public ref class in the vc++ project, which is
I have created a simple JQuery script with hovering effect on some links. The
I have created a simple WordPress plugin that automatically sets my new sites up
I have created a simple web browser using c# and I want to block

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.