Rules-Driven Workflow

The third workflow pattern that ships with Workflow Foundation is modeled by the PolicyActivity class. The policy activity uses the WF rules engine to incorporate rule based decision making into your workflows. A state or sequential workflow is based on a sequence of operations that evolve over time. Rules allow you to model relationships that are independent of time. You can also view these rules as constraints on the data consumed by your workflow.

The FinancialRecommendations example uses the PolicyActivity to execute a simple set of rules that allocates financial assets based on age, portfolio size, and expressed risk preference (see Figure 22).

Figure 22 Output from Financial Recommendations Application

Figure 23 ...

Get Building Applications with Windows Workflow Foundation: State Machine and Rules-Driven Workflows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.