Dynamic CRM 2013插件事件执行管道和2分钟超时 [英] Dynamic CRM 2013 Plugin Event execution pipeline and the 2 Minutes Time out

查看:99
本文介绍了Dynamic CRM 2013插件事件执行管道和2分钟超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个问题。

1-当插件A 触发事件并导致另一个插件B 触发,插件B 插件A 在同一事件执行管道中执行吗?

1- When plugin A triggers on an event and caused another plugin B to trigger, does Plugin B executes in the same Event execution pipeline as plugin A?

2-如果上述情况成立,并且插件A 插件B 在同一事件执行管道中执行,那么它们是否都需要2分钟才能完成(因为插件的最长执行时间为动态CRM是2分钟),或者每个CRM都有2分钟完成,这使得他们两个都可以完成的总执行时间是4分钟?

2- If the above is true and plugin A and Plugin B executes in the same Event execution pipeline do they both have 2 minutes to complete (since the maximum execution time of a plugin in dynamic CRM is 2 minutes) or each one of them has 2 minutes to complete which makes the total execution time allowed for both of them to complete is 4 minutes?

谢谢。

推荐答案

插件B将在插件A的子管道中执行。

Plugin B will execute in a child pipeline of plugin A.

在Dynamics CRM 2011中,为了简化插件开发,放弃了父管道和子管道的概念,但在后台仍然存在。您可以通过检查 IPluginExecutionContext.ParentContext 属性来找出您的插件在哪个上下文中执行。

In Dynamics CRM 2011 the concept of parent and child pipelines was abandoned in an attempt to simplify plugin development, but under the hood they still exist. You can find out in which context your plugin is executing be checking the IPluginExecutionContext.ParentContext property.

例如。当您的插件注册了一条Update消息时,父管道实际上可能正在Assign或SetState消息的上下文中运行。另外,当自定义插件代码对记录进行更新时,更新将在单独的子管道中执行。

E.g. when your plugin is registered for an Update message the parent pipeline can actually appear to be running in the context of an Assign or SetState message. Also, when custom plugin code is doing an update on a record, the update will be executed in a separate child pipeline.

在沙箱中,根管道必须在其中完成2分钟。对于同步插件步骤,这意味着所有后续子管道任务也需要在该窗口内完成。

In the sandbox the root pipeline has to complete within 2 minutes. For synchronous plugin steps this means all subsequent child pipeline tasks also need to be completed within that window.

异步插件步骤在这里不起作用,因为它们是在单独的进程中执行的。请记住,插件代码无法无休止地创建子管道实例。为了防止无休止的运行循环,系统允许插件的执行深度不超过8级。您可以使用属性 IPluginExecutionContext.Depth 进行检查。

Asynchronous plugin steps however do not play a role here, because these are executed in a separate process. Keep in mind plugin code cannot create child pipeline instances endlessly. In order to prevent endless running loops the system allows plugins to step no more than 8 levels deep. You can check this with property IPluginExecutionContext.Depth.

这篇关于Dynamic CRM 2013插件事件执行管道和2分钟超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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