MS CRM中的自定义工作流与插件 [英] Custom WorkFlows vs Plug-ins in MS CRM

查看:148
本文介绍了MS CRM中的自定义工作流与插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了许多插件代码来在CRM中实现业务逻辑,但是现在我想出了一个称为自定义工作流活动"的功能. 现在我想知道何时在插件上使用这些自定义工作流程?

I used a lot of Plug-in code to implement business logic in CRM but now I've came up with this feature called Custom Workflow Activity. now i wonder When to use these custom workflows over Plug-ins ?

推荐答案

我自己深入研究了这个主题,发现了一些我想分享的有趣的东西, 所以这是compare的完整列表:

I went deep into the subject myself and found interesting things i want to share, So here is the complete list of compare :

  • 插件只能触发数据更改(如更新或创建记录),但是自定义工作流程会参与流程(工作流程,对话框等)中

  • Plug-in's only fire on data change like updating or creating records but custom workflows take part inside a process ( workflow, dialog, ... )

因此,工作流不仅可以在数据更改时触发,而且可以在过程中的任何时候随时随地触发.您可能已经了解到,这是实现复杂的业务逻辑所需的真正的灵活性.

As a result , workflows not only can be triggered on data change, but on demand at anytime at any point inside their process. As you might have already understood, It is the real flexibility needed for implementing complicated business logic.

插件将不接受参数或传递的数据, 但是自定义工作流程可以通过使用如下所示的InArgument属性来实现:

Plug-ins won't accept arguments or passed-data, But custom workflows make it possible by using InArgument properties like below :

[Input("Case")]     //label of the field shown in workflow
[ReferenceTarget("incident")]     //if using EntityReference, must point the type
public InArgument<EntityReference> yourArg { get; set; } //almost every data type is supported

  • 工作流可以由业务用户简单地使用和操纵.

  • Workflows can be simply used and manipulated by business users.

    自定义工作流是绝对可重用的.有了一个寄存器,您就有了可以在几种情况下使用的业务逻辑. 在某些情况下,您甚至可能碰巧编写了可在许多不同实体上使用的代码.

    Custom Workflows are absolutely reusable. with one register you have a piece of business logic that can be used in several situations. in some cases you might even happen to write a code which can be used upon many different entities.

    到目前为止,您知道自定义工作流程比插件更可靠,但是让插件接管自定义工作流程的要点是当您验证数据更改并最终需要还原这些更改时.当然,这在自定义工作流程"中是可行的,但是添加插件比工作流程要容易得多.

    So far you know that custom workflow is more reliable than plug-in , but the point that makes a plugin's take over custom workflow is when you are validating data changes and eventually need to revert those changes . of course this is possible in Custom Workflows but it's much more easier to add a plugin than workflow.

    ,请记住,插件运行速度更快! (我自己测试过)

    and bare in mind that plugins run faster! (as i tested it myself)

    这篇关于MS CRM中的自定义工作流与插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆