Troubleshooting Workflow

Dynamics AX 2009

This topic describes common problems that can occur when you develop and test a workflow in Microsoft Dynamics AX.

The first step in troubleshooting a workflow problem is to see whether there are any Microsoft Dynamics AX best practice recommendations. To check best practices, right-click a workflow template, point to Add-Ins, and then click Check Best Practices. Implement the recommendations and then repeat the best practices check for each related workflow node. For more information, see Workflow Best Practice Checks.

To troubleshoot workflow X++ code, you must enable the Debugger tool, and setup workflow for debugging. For more information, see How to: Debug X++ Code in Workflow.

My new module is not available in the workflow category Module property setting

To view a new module name in the workflow category Module property drop-down list, it must be added to the ModuleAxapta enum. In the Application Object Tree (AOT), expand the Data Dictionary node, expand the Base Enums node, right-click ModuleAxapta, and then click New Element.

The Document class for my workflow template, task, or approval is not available in the Document property drop-down list

Only classes that override the WorkflowDocument Class are displayed in the Document property drop-down list.

My changes are not visible in the client.

Changes in metadata are not visible in the client immediately. To view changes in metadata in the client, close and restart the client.

The order of required elements in the workflow template cannot be changed

To change the order of an element, select the element and press ALT+UP ARROW or ALT+DOWN ARROW.

The debugger does not run in workflow

Workflow X++ code executes using the RunAs class in a new user session. To debug workflow event handlers and providers, this feature must be disabled. For more information, see How to: Debug X++ Code in Workflow.

You can use the Tutorial_WorkflowProcessor form in the AOT Forms node to simulate batch processing for a workflow. Open the form and then click Start to run the processor. The results of the batch processing simulation can be viewed in the Workflow History form. On the Inquiries pane in the Basic module, click Workflow history.

My workflow template does not appear in the configuration user interface

Any one or combination of the following items can prevent the display of a workflow template in the configuration user interface. Running the best practice checks for a workflow template node is the easiest method to identify problems. For more information, see Setting Up Best Practices Checks.

My task or approval does not display in the configuration user interface

  • Tasks and approvals can be added in the configuration user interface when they are not defined in the Workflow Templates Required Elements node. To add a task or approval workflow element, on the Setup pane, click Workflow configurations, click a configuration, click the Details tab, and then click Add.

    NoteNote

    An approval can only be added one time. The same task can be added many times.


  • A task or approval will not display in the configuration user interface unless the Document property setting is identical to the workflow template Document property setting.

The order of task or approval elements cannot be changed in the configuration user interface

Set the order of workflow template required tasks and approvals in the AOT in the Required Elements node. To change the order of an element, select the element and press ALT+UP ARROW or ALT+DOWN ARROW.

Tasks or approvals that are optionally added in the configuration user interface can be added and moved to any position in the workflow order.

Problems can occur with a workflow at runtime that cannot be seen at design time or configuration time. Therefore, we recommend that you test the workflow and the configuration in a test environment before you implement the solution. You can use the Tutorial_WorkflowProcessor form to simulate the batch process for testing.

The Submit button is not available on the workflow document form

  • Close and restart the client. Changes made to metadata are not immediately reflected in the user interface.

  • You must override the canSubmitToWorkflow method and it must return true to display the Submit button. For more information, see How to: Enable a Form for Workflow.

    NoteNote

    If there are no records in the data source and the canSubmitToWorkflow method returns true, an exception is thrown. Therefore, you should programatically check for a record when you evaluate the state of the workflow.


  • A security key is required on all display and action menu items.

  • An action menu item is required to enable display of the Submit button for the SubmitToWorkflow class that you must create for each workflow template. For more information, see How to: Create a SubmitToWorkflow Class.

  • All display and action menu items must point to a class that contains a main method.

  • The form must be enabled for workflow. For more information, see How to: Enable a Form for Workflow.

  • The form must have data and a line of data must be selected for the workflow.

  • There are no default configurations for the workflow. For more information, see "Configure a workflow" in the System and Application Setup Help.

  • There is a default configuration for the workflow, but it is not selected as Active. At least one configuration must be selected as active.

  • Is workflow installed? By default, workflow may not be installed. Run the Setup.exe file on the Microsoft Dynamics AX installation disk and select Workflow in the Roles pane. This option is not available if the workflow role is already installed. For more information, see the section below Troubleshooting Workflow Installation and Setup.

The workflow stops after the Submit button is clicked

  • If you use the WorkflowWorkCalendarDueDate provider, work items must have valid Working Times available in the system calendar to complete the work item. To set working times, on the Common forms pane in the Basic module, click Calendar.

  • A security key is required on all display and menu items for workflow task and approval elements.

  • Are workflow system accounts set up for workflow? On the Setup pane in the Administration module, expand the Security node, and then click System accounts. On the System service accounts form, set an Alias and Network domain for the Workflow System Account and the Workflow Execution Account.

  • Verify that the batch job is running or if the workflow batch job is in the batch job queue.

  • Verify that the IIS is running.

  • Check the Windows Event log on both the AOS and the computer hosting the IIS.

My task and approval outcome is not available on the workflow document form

  • Set the Enabled property setting for a task or approval outcome to Yes.

  • Each task or approval outcome must have the ActionMenuItem property defined.

There are unwanted spaces in my approval actions list

Set the Enabled property setting for task or approval outcomes that are not used in a workflow to No.

There are several reasons that a workflow may not run correctly that are related to how workflow was installed and set up. The following is a list of questions to consider when a workflow does not run correctly.

  • Is there a number sequence for configuration IDs? A configuration ID number sequence is required to create a configuration. To set number sequences, on the Setup pane in the Basic module, click Number sequences.

  • If you use the WorkflowWorkCalendarDueDate provider, are there valid working times in the system to assign a work item to? Work items must have valid Working Times available in the system calendar to complete the work item. To set working times, on the Common forms pane in the Basic module, click Calendar.

  • Is workflow installed? By default, workflow may not be installed. Run the Setup.exe file on the Microsoft Dynamics AX installation disk and select Workflow in the Roles pane. This option is not available if the workflow role is already installed.

  • Is Microsoft Share Point installed? By default, Share Point and other Web programs may use the IIS Default Web Site. Create a new web site URL for workflow on a different port using IIS Manager.

  • Do you have rights to run workflow? A valid security account must be set up.

  • Do you have a valid workflow URL for the Internet Information Service (IIS)? To validate your workflow URL for IIS, on the Setup pane in the Basic module, click Setting for workflow. On the Setting for workflow form, click the Administration tab, and then click Validate.

  • Are workflow system accounts set up for workflow? On the Setup pane in the Administration module, expand the Security node, and then click System accounts. On the System service accounts form, set an Alias and Network domain for the Workflow System Account and the Workflow Execution Account.

Community Additions

ADD
Show: