30 Sep 2011

Advanced Workflows SharePoint

 

A dependency property is a property that makes use of a shared repository for the workflow’s state

Namespace: System.Workflow.ComponentModel

Dependency Properties

A dependency property is a property that makes use of a shared repository for the workflow’s state

Dependency properties can be defined in three ways:

  1. Standard Property
  2. Metadata Property
  3. Attached Property

Custom Actions for SharePoint Designer 2010

You can write custom workflow activities  in Visual Studio of your own, making them available as custom actions in SharePoint Designer 2010,

Assemblies:
Microsoft.SharePoint.dll
Microsoft.SharePoint.WorkflowActions.dll

BaseClass: Activity

Important Method to override : Execute
protected override ActivityExecutionStatus Execute( ActivityExecutionContext executionContext) { }

XML manifest file: .ACTIONS extension.

 

Custom Conditions for SharePoint Designer 2010

A custom condition is just a logical condition that allows the workflow to perform a specific action only if the condition evaluates to true.

user interface of SharePoint Designer 2010 rendering the sample custom condition.

Workflow Event Receivers

A workflow event receiver is a custom class that inherits from the SPWorkflowEventReceiver.

WorkflowStarting Occurs after a workflow instance is starting.
WorkflowStarted Occurs after a workflow instance has been started.
WorkflowPostponed Occurs after a workflow instance has been postponed.
WorkflowCompleted Occurs after a workflow instance is completed.

Workflow Services

It would be better to have an infrastructural service that decouples the communication between the workflow and the CRM. In addition, the time delay spent waiting for the offer code from the external CRM shouldn’t burden the workflow engine.

The external data exchange infrastructure makes use of the CallExternalMethod and HandleExternalEvent activities

The offers approval workflow, extended with the CRM integration.

 

Base Class: SPWorkflowExternalDataExchangeService
Base abstract class WorkflowSubscriptionService

public override void CallEventHandler(Type eventType, string eventName, object[] eventData, SPWorkflow workflow, string identity, System.Workflow.Runtime.IPendingWork workHandler, object workItem) {}





 


Workflow Service Deployment


The deployment of a workflow service requires you to build a strongly-named assembly in
order to install the assembly file into the GAC. Next, you need to configure the workflow service
in the web.config of the web application


<WorkflowService Assembly="Dev.SP2010.ExternalCRMService, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=665aa2h4h32k420cb" Class="Dev.SP2010.
ExternalCRMService.CRMService"></WorkflowService>



 


NOTE:  You can define a feature receiver with a WebApplication scope to automatically configure the web.config file
The SharePoint Server Object Model provides a class named SPWebConfigModification specifically for the purpose configuring the contents of the web.config file automatically.

No comments:

Post a Comment