Presentation Workflow in Dynamics Ax
-
Upload
sirilucks6826 -
Category
Documents
-
view
221 -
download
0
Transcript of Presentation Workflow in Dynamics Ax
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 1/23
By,
Nasheet Ahmed Siddiqui
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 2/23
Agenda
• Workflow overview
• Workflow development• Query for a Workflow
• Workflow
category
• Workflow type
• Workflow elements
• Enable workflow on form
• Workflow Providers Overview
• Workflow configuration
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 3/23
Workflow is defined as the movement of documentsor tasks through a work process.
In Microsoft Dynamics AX, the focus of workflow ison approval and task-oriented workflows.
Workflow overview
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 4/23
Workflow overview
•
Developer design the workflow based on customerrequirements.
• The company administrator configures the workflow.• Users run the workflow.
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 5/23
The developer role in Microsoft Dynamics AX isprimarily to add workflow to existing business
documents or create new documents that supportworkflow.
Creating a query for a workflow.
Creating a workflow category.
Creating a workflow type in the AOT.
Creating Workflow elements
Enable workflow on the form.
Workflow development
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 6/23
In the AOT, right-click the Queries node, and then select New
Query. A query group displays under the Queries node.
Right-click the new query, click Rename, and then enterMyQuery.
Expand the new query, right-click the Data Sources node, andthen click New Data Source. A data source group displaysunder the Data Sources node.
Right-click the new data source group and then click Properties. In the Properties sheet, set the Table property to CustTable.
Expand the CusTable_1 data source, and select the Fields node.In the Properties sheet, set the Dynamic property to Yes.
Query for a Workflow
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 7/23
In the AOT, expand the Workflow node.
Right-click the Workflow Categories node, and then select
New Workflow Category. A new workflow categorygroup displays under the Workflow Categories node.
Right-click the new workflow category and then clickProperties.
In the Properties sheet, set the name and moduleproperties.
In the AOT, right-click MyWorkflowCategory, and thenclick Save.
Workflow Category
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 8/23
The Workflow type is a building block that can be used to
create customized workflows that enforce businesspolicies.
In Microsoft Dynamics AX, you enable the workflowprocess for a workflow document by creating Workflowtypes that are used in the workflow configuration userinterface.
A Workflow type defines information about:
Which workflow document to use. Tasks and approvals that can be configured by the end-user. Workflow categories used for assigning a Workflow type to
a specific module. Menu items and event handlers.
Workflow Type
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 9/23
In AOT->Workflow->Workflow Types->NewWorkflow type.
Workflow Type
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 10/23
The workflow document class that you create definestable fields for conditions in two ways:
1. The Application Object Tree (AOT) query. ThegetQueryName method of the Workflow DocumentClass must be overridden to return the name of thequery.
2. Parameter methods. You can optionally addcalculated fields by adding parameter methods with aspecific signature on the class.
Workflow Type(Define the workflow document)
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 11/23
Microsoft Dynamics AX workflow uses events to
initiate business logic in your application. For
example, the workflow type has a property eventhandler for business logic when a workflow isstarted.
Workflow event handlers in Microsoft Dynamics AX
enable you to run application-specific business logicat key points during workflow execution. Workflowevents are implemented at the workflow level andthe workflow element level
Workflow Events
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 12/23
Event Description
WorkflowStartedEventHandler
This event raises when the workflow instance starts.
WorkflowCompletedEventHandler
This event raises when the workflow instance ends after it is completed.
WorkflowCanceledEventHandler
This event raises when the workflow instance ends after it is canceled. Use this event handler toperform any cleanup operations needed.
WorkflowConfigDataChangeEventHandler
This event raises when the workflow configuration data changes. Use this event handler toidentify when a configuration has changed. For example, if you create an association betweenthe application data and a workflow configuration, this event handler would raise if the
configuration was deleted or updated.
Workflow Level Event
Handlers• At the workflow level, event handlers are provided for the workflow
started, completed, canceled, and configuration data change events.• WorkflowHandler class implements WorkflowCanceledEventHandler,
WorkflowCompletedEventHandler,WorkflowStartedEventHandler.
• Started,completed and canceled methods create to handle below events.
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 13/23
Create a submitWorkflow and CancelWorflowmenuitems.
Set the object property of submitwork menuitem tothe SubmitWorkflow class.
Set the object property of CancelWorflow menuitemto the WorkflowCancelManager class.
Workflow Menu Items
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 14/23
In Microsoft Dynamics AX, a workflow is startedwhen the user clicks the Submit button on the
workflow toolbar. The Submit button is bound to an action menu item
that calls the main method on a SubmitToWorkflowclass.
Workflow activation is added in the main methodfrom the workflow type name.
SubmitToWorkflow
Class
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 15/23
public static void main(Args args) { // Variable declaration. recId _recId = args.record().RecId; WorkflowCorrelationId _workflowCorrelationId; // Hardcoded type name workflowTypeName _workflowTypeName = workFlowTypeStr("MyWorkflowType"); // Initial note is the information that users enter when they // submit the document for workflow. WorkflowComment _initialNote = "";
WorkflowSubmitDialog workflowSubmitDialog;
// Opens the submit to workflow d ialog. workflowSubmitDialog = WorkflowSubmitDialog::construct(args.caller().getActiveWorkflowConfiguration()); workflowSubmitDialog.run();
if (workflowSubmitDialog.parmIsClosedOK()) { _recId = args.record().RecId; // Get comments from the submit to workflow dialog. _initialNote = workflowSubmitDialog.parmWorkflowComment();
try { ttsbegin;
// Activate the workflow. _workflowCorrelationId = Workflow::activateFromWorkflowType(_workflowTypeName, _recId, _initialNote, NoYes::No);
// Send an Infolog message. info("Submitted to workflow.");
ttscommit; }
catch(exception::Error) { info("Error on workflow activation."); } } }
SubmitToWorkflow
Class
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 16/23
The elements of a workflow are created by you in the
AOT and configured by application administrators. Theworkflow structure consists of sequences of workflowelements. An element can be a task, approval, or a sub-workflow.
A task is a workflow element with a single step defined inthe Application Object Tree (AOT) that is used toimplement task-based processes.
An approval is a specialized task that can have multiplesteps defined in the AOT that is used to implementapproval processes.
Workflow elements
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 17/23
You can use workflow approvals to track the status of a
workflow document that has fixed workflow outcome
types such as Approve, Reject, Deny, or RequestChange. AOT->WorkFlow>Approvals-> New Approval
Associate an Action Menu Item with a WorkflowApproval
Associate a Display Menu item with a WorkflowApproval
Create and implement event handlers on the workflowapproval
Create a Workflow Approval
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 18/23
A workflow may contain one or more tasks.
However, each task may only contain one step with
one or more outcome types.AOT->WorkFlow->Tasks-> New Task
Associate an Action Menu Item with a WorkflowTask
Associate a Display Menu item with a WorkflowTask
Create and implement event handlers on theworkflow task
Create a Workflow Task
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 19/23
Property Value
WorkflowEnabled Yes
WorkflowDataSource CustTable
WorkflowType CustWorkflow
Enable Workflow on
Form1.In the AOT, expand the Forms node.
2.Expand the CustTable form, and then expand the Designs node.
3.In the Designs node, right-click the Design child node, and then
click Properties.
4.In the Properties sheet, set the following properties.
5.In the AOT, right-click the CustTable form, and then click Save.
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 20/23
After the form is enabled for workflow, you will adda canSubmitToWorkflow method to the form. This
method runs before the Submit button is enabled toverify that the workflow document is in a valid stateto submit to workflow.
Enable Workflow on
Form
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 21/23
In Microsoft Dynamics AX, you can use workflowproviders to provide application-specific information
to a workflow instance at runtime. For example, you can use workflow providers to
determine who is required to approve an invoice, orby which date an invoice payment is considered to
be late.
Workflow Providers
7/29/2019 Presentation Workflow in Dynamics Ax
http://slidepdf.com/reader/full/presentation-workflow-in-dynamics-ax 22/23
Hierarchy Assignment Determines a user ID based on a search in a hierarchy.
Due date Determines the due date for a task or approval, or the
due date for a step in a task or approval.
Participant Resolves a user group or role into one or more specific
user IDs.
Workflow Providers Types