clicksor

Tuesday, August 14, 2012

MS CRM 2011: Work Flow - Events & debugging

Work Flow:



Overview of  Work flow:


A Microsoft Dynamics CRM process is based on the Windows Workflow
Foundation 4.0 programming model. Windows Workflow Foundation provides a
run time engine, a framework, a base library of activities, and default
implementations of the run time services. The Windows Workflow Foundation
run time engine manages process execution, and supports processes that can
remain active for extended periods of time. It preserves the state of process
execution during computer shutdown and restart.

Whereas many workflows which comprise a customer solution will be created
within the Process Design area of the application, there are other options for a
workflow to be extended through the SDK. Using the Microsoft Dynamics CRM
SDK, customizers can do the following:

Custom Workflow Activities (On-premise only):

Create custom workflow activities to extend workflows by creating an assembly
that contains a class derived from one of the Windows Workflow Foundation
activities. Then, you register the assembly with Microsoft Dynamics CRM to use
it as an activity in a process. After registration is successful, the custom
workflow activity will appear as an action within the process design interface.

Custom XAML Workflows (On-premise only):

Create workflows by using the Microsoft Visual Studio workflow designer to
visually design workflows without writing code, and import the workflow
definition (XAML) file into Microsoft Dynamics CRM. Then you can use the
workflow without compiling it. Additionally, existing workflows in Microsoft
Dynamics CRM 2011 can be exported and brought into Visual Studio, modified,
and imported back into the application.


Events

Workflow rules can be bound to the following events and can be performed on an
entity instance:

• Assign
• Attributes Change (Update)
• Change Status
• Create
• Delete
• On Demand


Debugging Custom Workflow Activities

The first step in debugging is to make sure the assembly is registered correctly.
Search for errors in the event log. If there are no errors in the event log, and there
are no visible errors from the assembly, then the assembly is not being loaded
and called, and most likely, the problem is a configuration issue.

NOTE: A program database (PDB) file holds debugging and project state
information that is used for the incremental linking of a Debug configuration of
the program. A PDB file is created when compiling a Visual Basic .NET or C#
program by using debug.

Use these steps to debug a custom workflow assembly:

1. Copy the .pdb file for the assembly to the
%installdir%\server\bin\assembly folder. The assembly can be
deployed as on-disk or stored in the database. The recommended
deployment is in the database, but for debugging one should select
on-disk.

2. Next, attach the debugger to the Microsoft Dynamics CRM
asynchronous service process (CrmAsyncService.exe).

3. Remove the .pdb file when finished debugging because it uses
memory to have it loaded.




No comments:

Post a Comment