Skip to content

Commit 79ff729

Browse files
authored
Merge pull request #1732 from MicrosoftDocs/master-jdaly-6-20-19
Master jdaly 6 20 19
2 parents e1e8efd + 88efaf4 commit 79ff729

File tree

3 files changed

+49
-7
lines changed

3 files changed

+49
-7
lines changed

powerapps-docs/developer/common-data-service/understand-the-data-context.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Understand the execution context (Common Data Service) | Microsoft Docs"
33
description: "Learn about the data that is passed to your plug-ins when it is executed."
44
ms.custom: ""
5-
ms.date: 05/25/2019
5+
ms.date: 06/20/2019
66
ms.reviewer: pehecke
77
ms.service: powerapps
88
ms.topic: "article"
@@ -168,11 +168,12 @@ When you define an entity image, you specify an entity alias value you can use t
168168
var oldAccountName = (string)context.PreEntityImages["a"]["name"];
169169
```
170170

171-
More information: [Define entity images](register-plug-in.md#define-entity-images)
171+
More information:
172+
173+
- [Define entity images](register-plug-in.md#define-entity-images)
174+
- [Entity Images for workflow extensions](workflow/workflow-extensions.md#entity-images-for-workflow-extensions)
172175

173-
### Entity Images for custom workflow activites
174176

175-
There is no way to configure entity images for custom workflow activities since you only register the assembly and the workflow activity runs in the context of the workflow. For custom workflow activities entity images are available using the key values `PreBusinessEntity` and `PostBusinessEntity` respectively for the pre and post entity images.
176177

177178
### See also
178179

powerapps-docs/developer/common-data-service/workflow/workflow-extensions.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Workflow Extensions (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "You can extend the options available within the designer for workflows. These extensions are added by adding an assembly that contains a class the extends the CodeActivity class. These extensions are commonly called workflow assemblies or workflow activities." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 06/12/2019
5+
ms.date: 06/20/2019
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -400,6 +400,44 @@ If you make changes that include significant changes to public classes or method
400400

401401
When all processes are converted to use the new assembly, you can use the Plug-in Registration tool to Unregister the assembly, so it will no longer be available. More information: [Unregister components](../register-plug-in.md#unregister-components)
402402

403+
## Performance Guidance
404+
405+
Performance considerations for your workflow extensions are the same as for ordinary plug-ins. More information: [Performance considerations](../write-plug-in.md#performance-considerations)
406+
407+
Unlike an ordinary plug-in, with workflow extensions you do not have the opportunity to explicitly register your code for a specific step. This means you don't control whether the code in your workflow extension will run synchronously or asynchronously. Particular care must be considered for code that runs synchronously because it will directly impact the application user's experience.
408+
409+
As re-usable components, workflow extensions can be added to any workflow or custom action. The workflow may be configured as a *real-time* workflow, which means it will run synchronously. Custom actions are always synchronous, but they do not participate in a transaction unless they have **Enable rollback** set.
410+
411+
> [!IMPORTANT]
412+
> When your workflow extension is used in a synchronous workflow or a custom action the time spent running the code directly impacts the user's experience. For this reason, workflow extensions should require no more than two seconds to complete when used synchronously. If your extension requires more time than this, you should document this and discourage use of the extension in synchronous workflows or custom actions.
413+
414+
You should also be aware that in a synchronous workflow or a custom action that that participates in the transaction, any error thrown by your workflow extension will cause the entire transaction to rollback, which is a very expensive operation that can impact performance.
415+
416+
You can use the value in the <xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext>.<xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext.WorkflowMode> property to determine if the plug-in is running synchronously.
417+
418+
## Real-time workflow stages
419+
420+
When a workflow extension is used in a real-time (synchronous) workflow it will be invoked in the event execution pipeline stages shown in the following table. For more information : [Event execution pipeline](../event-framework.md#event-execution-pipeline)
421+
422+
|Message |Stage |
423+
|---------|---------|
424+
|**Create**|PostOperation|
425+
|**Delete**|PreOperation|
426+
|**Update**|PreOperation or <br /> PostOperation|
427+
428+
You can use the value in the <xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext>.<xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext.StageName> property to detect the stage.
429+
430+
For the **Update** operation, the stage is configurable using **Before** or **After** options in the workflow designer. More information: [Using real-time workflows](/flow/configure-workflow-steps#using-real-time-workflows)
431+
432+
If your workflow extension depends on data passed in the execution context, the stage it runs in will control whether data is available in the <xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext>.<xref:Microsoft.Xrm.Sdk.IExecutionContext.InputParameters> and <xref:Microsoft.Xrm.Sdk.Workflow.IWorkflowContext>.<xref:Microsoft.Xrm.Sdk.IExecutionContext.OutputParameters>.
433+
434+
> [!NOTE]
435+
> We don't recommend including logic dependencies based on the <xref:Microsoft.Xrm.Sdk.IExecutionContext.InputParameters> and <xref:Microsoft.Xrm.Sdk.IExecutionContext.OutputParameters>. Workflow extensions should depend on the configured [input and output parameters](#input-and-output-parameters) so that the person using the workflow extension can understand the expected behavior without having anything hidden from them.
436+
437+
## Entity Images for workflow extensions
438+
439+
There is no way to configure entity images for workflow extensions since you only register the assembly and the workflow activity runs in the context of the workflow. For workflow extensions entity images are available using the key values `PreBusinessEntity` and `PostBusinessEntity` respectively for the pre and post entity images. More information: [Entity Images](../understand-the-data-context.md#entity-images)
440+
403441

404442
### See also
405443

powerapps-docs/developer/common-data-service/write-plug-in.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Write a plug-in (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Learn about the concepts and technical details necessary when writing plug-ins" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 05/26/2019
5+
ms.date: 06/20/2019
66
ms.reviewer: ""
77
ms.service: powerapps
88
ms.topic: "article"
@@ -155,7 +155,10 @@ More information: [Use Tracing](debug-plug-in.md#use-tracing), [Logging and trac
155155

156156
## Performance considerations
157157

158-
When you add the business logic for your plug-in you need to be very aware of the impact they will have on overall performance. The business logic in plug-ins should take no more than 2 seconds to complete.
158+
When you add the business logic for your plug-in you need to be very aware of the impact they will have on overall performance.
159+
160+
> [!IMPORTANT]
161+
> The business logic in plug-ins registered for synchronous steps should take no more than 2 seconds to complete.
159162
160163
### Time and resource constraints
161164

0 commit comments

Comments
 (0)