November 6, 2016

Part 1: Windows workflow foundation (WWF)

WWF is workflow Framework for Microsoft product.

WF Framework is compose of library,Execution Engine, Rules engine, a number of activities, a number of supporting runtime services.

WF contains graphical debugger.

The engine is designed in such a way that the developer has a free choice between building the workflow as code constructs or in a declarative fashion using XAML. 

Workflow: A workflow models a process as a set of activities applied to work in progress.

A workflow is constructed from a number of activities, and these activities are executed at runtime.

A number of built-in activities can be used for general-purpose work, 
and you can also create your own custom activities and plug these into the workflow as necessary


Workflow Runtime Engine: 
Every running workflow instance is created and maintained by an in-process runtime engine that is commonly referred to as the workflow runtime engine. 

There can be several workflow runtime engines within an application domain. 

Each instance of the runtime engine can support multiple workflow instances running concurrently.

Because a workflow is hosted in-process, a workflow can easily communicate with its host application.


Why should we use ?

  • Can see workflow visually. (More understandable way)
  • Separation between business logic and its implementation
  • No Need to Complie the workflow as it is xml. This flexibility even goes further and the engine allows for the runtime alteration of the executing workflow.
  • Due to it is library,it is flexible to included in application or site.

Activities : Activities run like tree structure.
Activities have two types of behavior
Runtime: specifies the actions upon execution.
Designtime: controls the appearance of the activity and its interaction while being displayed within the designer. 

Services
The workflow runtime engine uses many services when a workflow instance runs. Windows Workflow Foundation provides default implementations of the runtime services that meet the needs of many types of applications, such as a persistence service, which stores the execution details of a workflow instance in a SQL database. These service components are pluggable, which allows applications to provide these services in ways that are unique to their execution environment. Other types of services used by the runtime engine include scheduling services, transaction services, and tracking services.

Custom services can be created to extend the Windows Workflow Foundation platform by deriving from the base service classes. An example of this would be a persistence service that uses an XML file instead of a database for storage.

Persistency :

Windows Workflow Foundation simplifies the process of creating stateful, long-running, persistent workflow applications. The workflow runtime engine manages workflow execution and enables workflows to remain active for long periods of time and survive application restarts. This durability is a key tenet of Windows Workflow Foundation. It means that workflows can be unloaded from memory while awaiting input and serialized into a persistent store, such as a SQL database or XML file. Whenever the input is received, the workflow runtime engine loads the workflow state information back into memory and continues execution of the workflow.

Windows Workflow Foundation provides the SqlWorkflowPersistenceService that integrates well with Microsoft SQL Server to persist workflow information easily and efficiently. You can also create your own persistence service to store workflow state information anywhere you want by deriving from the WorkflowPersistenceService base class. 

Tracking
Tracking is the ability to specify and capture information about workflow instances and store that information as the instances execute. Windows Workflow Foundation provides the SqlTrackingService, which is a tracking service that uses a SQL database to store the collected tracking information. You can also write your own tracking service to collect and store this information in any format that your application requires.

When a new workflow is created, the tracking service requests a tracking channel to be associated with that workflow. All of the tracking information from the workflow is then sent to this tracking channel.

The tracking service can track three types of events:
  • Workflow instance events
  • Activity events
  • User events
You can configure the type and amount of information that your service wants to receive for a particular workflow instance or types of workflow by providing a tracking profile.

The tracking framework also provides the ability to extract information about activities or the workflow during an event. If a specific property or field in your activity or workflow needs to be tracked, you can provide this information in the extracts section of the tracking profile, and that information will be extracted during the specified event. 

Serialization
Workflows, activities, and rules can be serialized and deserialized. This enables you to persist them, use them in workflow markup files, and view their properties, fields, and events in a workflow designer.

Windows Workflow Foundation provides default serialization capabilities for standard activities, or you can create your own for custom activities. For example, with a custom activity serializer, you can decide which members are serialized and how they are serialized. This determines if those members are visible or hidden in a workflow designer

No comments: