Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Workflow in Dynamics AX 2009 : Workflow Life Cycle (part 2) - Creating the Workflow Document Class

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/14/2013 5:57:45 PM
1.3 Creating the Workflow Document Class

The purpose of a workflow is to automate all or part of a business process. To do this, it must be possible to define various rules over the document that is being processed by workflow. In Dynamics AX 2009, these rules are referred to as conditions. A business user creates conditions in workflow when configuring the workflow. Conditions can be used, for example, to decide whether a purchase requisition should be approved automatically (without any human intervention). Figure 4 shows a simple condition defined in the workflow configuration form.

Figure 4. A simple condition defined in the workflow configuration form

When a business user is configuring a condition by using the workflow configuration form, he or she needs to make sure the users have a way to select the fields from the workflow documents they want to use. On the surface, this configuration seems simple, but two requirements complicate the task. First, the user must be able to filter the available fields because not all the fields in a table might make sense to the business user. Second, it must be possible to use calculated fields (also referred to as derived data). The workflow document class meets these two requirements by functioning as a thin wrapper around an AOT query that defines the available fields and by providing a mechanism for defining calculated fields.

The AOT query enables developers to define a subset of fields from one or more related tables. By adding nested data sources in a query, you can model quite complex data structures, but most commonly the nested query is used to model a header-line pattern. At design time, when the business user is configuring a workflow, the AOT query is simply used by the condition editor to figure out which fields to display to the business user.

The workflow infrastructure uses a prescriptive pattern to support calculated fields using parm methods that are defined within the workflow document class. These methods must be prefixed with parm and must implement a signature of (CompanyId, TableId, RecId). The workflow infrastructure then, at run time, calls the parm method and uses the return value in the condition evaluation. This design enables developers to implement calculated fields in parm methods on the workflow document class.

Note

When the expression builder constructs the list of fields, it uses the labels of the table fields as the display name for the fields. The display name for calculated fields is defined by the extended data type label of the return types. For enums, this is defined by the enum element label.


Creating a workflow document class involves creating an X++ class that extends from WorkflowDocument. You must override getQueryName to return the name of the workflow document query. Figure 5 shows a sample X++ class that extends from the workflow document.

Figure 5. A sample X++ class that extends from the workflow document

Creating a parm method involves adding a method to the workflow document class and then adding X++ code to calculate or otherwise determine the value to be returned, as you can see in Figure 6.

Figure 6. A parm method within a workflow document class that returns the approval amount (which is calculated)

Note

All condition comparisons assume that any literal monetary value typed into a condition is in AmountMST, which is the default company currency. Thus, if a parm method returns a value that represents a monetary amount, it must always be returned in AmountMST.


1.4 Adding a Workflow Display Menu Item

The workflow display menu items enable users to navigate directly to the Dynamics AX 2009 client form (or Enterprise Portal Web page) upon which they can select one of the available workflow actions. A user is prompted to participate in a workflow when he or she receives a work item from the workflow at run time. When viewing the work item, the user can click Go To <Label>. This button is automatically mapped to the workflow display menu item, and the button text (“<Label>”) is the label of the root table of the workflow document query.

This design enables developers to create task-based forms that are focused on the particular task at hand, rather than having to create monolithic forms that assume the user knows where in the process he or she is acting and which fields and buttons to use.

Other -----------------
- Workflow in Dynamics AX 2009 : Workflow Architecture
- SharePoint 2010 : Configuring Search Settings and the User Interface - Search Tabs and Pages
- SharePoint 2010 : Configuring Search Settings and the User Interface - Search Scopes
- SQL Server 2008 R2 : Performance Monitoring Tools (part 12) - Viewing Data Collector Set Results in Performance Monitor
- SQL Server 2008 R2 : Performance Monitoring Tools (part 11) - Creating Data Collector Sets in Performance Monitor
- SQL Server 2008 R2 : Performance Monitoring Tools (part 10) - Creating an Extended Events Session
- SQL Server 2008 R2 : Performance Monitoring Tools (part 9) - Creating an Extended Events Session
- SQL Server 2008 R2 : Performance Monitoring Tools (part 8) - Extended Events Catalog Views and DMVs
- SQL Server 2008 R2 : Performance Monitoring Tools (part 7) - SQL Server Extended Events
- SQL Server 2008 R2 : Performance Monitoring Tools (part 6) - SQL Server Utility
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server