Tuesday, April 12, 2016

WorkFlow Performance issues in Ax 2009

I recently came across a performance issue with WorkFlow Configured for Purchase Orders in Ax 2009. As we all know that WorkFlow can be setup  at various Functions like Purchase order/Sales Order etc..  
(Please refer to this URL if you need more information
http://msdn.microsoft.com/en-us/library/cc585061(v=ax.50).aspx)

Our client had setup the workFlow for Purchase Order. The entire configuration was fine and the system was working fine with various workFlow Conditions that were setup during the creation of Purchase Order. 
When the user started adding more items in a purchase order then the system started performing slowly. For Example. if we have around 200 items under the same purchase order, then work Flow would have to loop through all the 200 items to see which condition is met and which WorkFlow Configuration was a success. The problem that i found  was the system is looping through all the 200 items and also through each workFlow Configuration.This is because the WorkFlow is designed in such a way that if one of the workFlow Configurations are met then system still look for all other workFlow Configurations that might also succeed. Then the system would evaluate the best configuration based on the Default setting that is setup in workFlow Configuration. So this led to the vast amount of time being consumed in evaluating the valid WorkFlow for a particular Purchase Order. 

The Solution for this as a workAround was to exit when ever the System finds the valid workFlow Configuration so that it does not have to loop through all the configurations. The work around was mainly done because our client does not have duplicate workFlow configurations. This was basically driven a parameter that is setup in Account Payables to see whether we need drive the WorkFlow Configurations single or multiple. 
The changes have been done in 

Classes --> WorkFlow --> findWorkflowConfigToActivateForTemplate method where the system would look for a valid configuration.

I hope you find this information helpful. Any new thoughts would be appreciated.



No comments:

Post a Comment