Saturday, July 31, 2010

Categories

Minimize

Archive

Minimize

Tag Cloud

Minimize

Altriva Team Blog

Minimize

Custom Extensions – Custom Workflow Activities vs. Plug-ins

Posted by: Hoss Hostetler on 1/16/2009
  • Categories:
  • CRM

Today’s CRM Success blog entry will focus on when to use Workflows with Custom Workflow Activities (AKA Workflow Assemblies) and when to use Plug-ins when registering .NET assemblies to help facilitate business processes in CRM.

Workflows with Custom Workflow Activities vs. Plug-ins in Microsoft Dynamics CRM 4.0

We will start with high-level guidelines of when to use each tool and then get into the specifics of how the tools work within the Microsoft Dynamics CRM 4.0 Execution Pipeline with regards to the synchronous and asynchronous processing of events in a later blog post. We will not get into definitions of Custom Workflow Activities and Plug-ins or provide code samples since these are accessible from the CRM SDK documentation (click links to view).

As described in an earlier post “Custom Extensions Discussion - Intro”:

The best way to approach the custom extension capabilities of Microsoft Dynamics CRM 4.0 is to first fully understand your business processes, specifically which parts of those processes are causing you pain or costing your business money. The next step is to build those processes into CRM using the base CRM functionality and then re-examining your system to see which pain points remain. Then, with a good working understanding of all the ways you can extend Microsoft CRM, design your custom extensions to relieve the remaining pain points while taking into account the pros and cons of each custom extension approach.

Creating workflows through the CRM client (without calling custom assemblies) is a powerful way to improve business process facilitation. Basic workflow provides many benefits: no need for .NET expertise to develop, easy to modify (no code changes required), and you can export and import them like customizations. However, basic workflow also has its functional limitations. Fortunately, Microsoft Dynamics CRM 4.0 supports Custom Workflow Activities and Plug-ins for calling custom .NET assemblies to extend beyond basic workflow limitations. Given their similarities, it can be difficult to decide which method to use. Below are guidelines to consider when choosing your extension tool.

High-level Usage Guidelines

  1. Custom Workflow Activities can only execute.NET assemblies asynchronously, while Plug-ins can execute .NET assemblies both synchronously and asynchronously. If you have already decided that your extension needs to execute synchronously, the choice is simple: Plug-ins are the only way to go. Synchronous and asynchronous event execution will be covered in detail in a following post with a description of the Execution Pipeline Synchronous vs. Asynchronous and examples.
  2. If your .NET assembly is one step in a multi-step workflow, use Custom Workflow Activities. Workflow maintenance is simplified when all of the processing logic is in one place. This is especially true if a business process requires a mix of basic steps and Custom Workflow Activities to occur in a specific order. If you instead put your basic steps in a workflow and register you custom code as an asynchronous Plug-in, you’d have two places to maintain the processing logic and you would not be able to control the order in which the plug-in and workflow execute.
  3. If you want to track a history of when your .NET assembly was run against an entity, use Custom Workflow Activities. Otherwise, use Plug-ins. Each time a workflow runs, a record of it is audited in CRM. This can be useful in some cases and distracting or unnecessary in other cases.
  4. If you want the flexibility to easily disable or change what triggers a .NET assembly without changing code, use Custom Workflow Activities. Using Custom Workflow Activities within a workflow gives you the flexibility to publish and un-publish changes to the “Start when:” settings on the workflow form. It also allows users to run .NET assemblies against records as an on demand workflow.  The ability to quickly remove or add in custom logic to a workflow that business users can control can be very helpful especially with processes that are either dynamic or will be changing frequently.
  5. If none of the above applies, it comes down to personal preference. We suggest Plug-ins. Generally speaking, it simplifies business logic maintenance to manage most of your .NET assemblies in the same place. Since Plug-ins can do both synchronous and asynchronous processing, and there is a good chance your system will require synchronous plug-ins at some point, it makes sense to register the asynchronous .NET assemblies as Plug-ins as well.

Conclusion

To close, there are quite a few things to consider when deciding when to use Workflows with Custom Workflow Activities and when to use Plug-ins. If you intend to register your .NET assembly synchronously or you don’t intend to leverage any of workflow’s basic functionality, use a Plug-in. If you’re ok with asynchronous processing and your .NET assembly is a sub-process in a contiguous workflow, you want an audit history, or you want to ease event trigger administration, use a Custom Workflow Extension.

- Phil Edry & Hoss Hostetler

Create a trackback from your own site.

0 Comments

Leave A Comment



Please enter the CAPTCHA phrase above.



  
  

Recent Comments

Minimize

"Hi Lee -- I would just create one-off workflows for each user in your system in that case. Or, create a number of sync users for yourself, and then bulk edit those sync users to another record." Read more
by Phil Edry on Allow Multiple Users to Sync the Same Contact to Outlook Effortlessly with Microsoft CRM

"Norbert and Jeff -- CRM Online couldn't support this exact setup due to current limitations with plug-ins. However, a different integration could be developed that would work with Online and BPOS. If you'd like additional information, please feel free to email info@altriva.com." Read more
by Phil Edry on CRM to SharePoint Site Creation and Clients List Integration

"great article thanks Would the CRM security model be adhered to by the calendar? I have 30 business units in CRM and want a shared calendar at the BU level but for users to only see the records from thier BU and not the whole system. Would be nice not to have to build multiple calendars?" Read more
by Jeff Murtari on Adding a Custom Calendar to the CRM UI

"I also have the same question as Norbert. I'm very interested in this if you're able to do this with CRM Online. " Read more
by Jeff Snyder on CRM to SharePoint Site Creation and Clients List Integration

"Would i be able to do this with the online versions of CRM and BPOS? " Read more
by Norbert on CRM to SharePoint Site Creation and Clients List Integration

"Thanks guys this has solved a major hurdle for us. I may be missing something obvious here but is it possible to modify the workflow, so that "Sync User" can be selected as we have a situtation where the PA would like to set the 'Sync User' for multiple contacts as their manager." Read more
by Lee Southam on Allow Multiple Users to Sync the Same Contact to Outlook Effortlessly with Microsoft CRM

"Good example... event more flexible then CRM Customization Manager" Read more
by Peter Olsson on Export CRM customizations using PowerShell

"Thanks! I encountered this same error, so this was helpful. It would be nice to know what attributes are causing the problem. I heard that some rollups actually changed the size of some attributes. I'm not sure how that would be related to CRM Online or if it could be impacted by the date the organization started using CRM." Read more
by Gretchen Mann on Importing Customizations from one CRM Online Instance to Another CRM Online Instance

  
Copyright 2010 by Altriva LLC