Is this a good workflow system design?

I am developing a system that will allow me to present wide-scope tasks as workflows that expose their work items using the IEnumerable method. The goal is to use the C # 'yield' mechanism to allow me to write pseudo-process code that the workflow runtime system can execute as it sees fit.

For example, let's say I have a workflow that involves running a query in a database and sending an email alert if the query returns a specific result. This may be a workflow:

public override IEnumerable<WorkItem> Workflow() {
    // These would probably be injected from elsewhere
    var db = new DB();
    var emailServer = new EmailServer();

    // other workitems here

    var ci = new FindLowInventoryItems(db);
    yield return ci;

    if (ci.LowInventoryItems.Any()) {
        var email = new SendEmailToWarehouse("Inventory is low.", ci.LowInventoryItems);
        yield return email;
    }

    // other workitems here
}

CheckInventory EmailWarehouse - , WorkItem, Execute(), , . Execute() - WorkflowRunner, Workflow(), - - Execute . , , , , ..

, , , , , , . , IEnumerable #, , - , , - . , , .

, , ? , - ( , , ), ( ), .. - , ? , - ?

+5
2

" ". -, .

, , , -, .

:

, , , .

, , .

, " ".

, , .

- . EmailNotifier, , . ? ? Blackberry? , .

? , , .

, , , , -?

. .

+2

@Erik: ( .) , . WF , , WF-.

Workflow .Net "Workflow Foundation (WF)". , , , duffymo " ".

XAML Visual Studio. ( , )

  • ( , )
  • ( 'State' to 'State', , )
  • , ( Sequential/StateMachine . )

: Windows Workflow Foundation

MSDN: Workflow Foundation (WF)

0

All Articles