Workflow in Dynamics AX - Nasheet - DAX Helper | This blog contain development ??PPT fileWeb view2012-02-01Workflow in Dynamics AX 2012. By, Nasheet Ahmed Siddiqui. Agenda. Workflow overview. Workflow development. Query for a Workflow . Workflow category. Workflow type . Workflow elements. Enable workflow on form. Workflow ...

Download Workflow in Dynamics AX - Nasheet - DAX Helper | This blog contain development  ??PPT fileWeb view2012-02-01Workflow in Dynamics AX 2012. By, Nasheet Ahmed Siddiqui. Agenda. Workflow overview. Workflow development. Query for a Workflow . Workflow category. Workflow type . Workflow elements. Enable workflow on form. Workflow ...

Post on 02-Apr-2018

217 views

Category:

Documents

4 download

TRANSCRIPT

Workflow in Dynamics AXWorkflow in Dynamics AX 2012By,Nasheet Ahmed SiddiquiAgendaWorkflow overviewWorkflow developmentQuery for a Workflow Workflow categoryWorkflow type Workflow elementsEnable workflow on formWorkflow Providers OverviewWorkflow configurationWorkflow is defined as the movement of documents or tasks through a work process. In Microsoft Dynamics AX, the focus of workflow is on approval and task-oriented workflows. Workflow overviewWorkflow overviewDeveloper design the workflow based on customer requirements. The company administrator configures the workflow.Users run the workflow. The developer role in Microsoft Dynamics AX is primarily to add workflow to existing business documents or create new documents that support workflow.Creating a query for a workflow. Creating a workflow category. Creating a workflow type in the AOT. Creating Workflow elementsEnable workflow on the form.Workflow developmentIn 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 enter MyQuery. Expand the new query, right-click the Data Sources node, and then click New Data Source. A data source group displays under 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 WorkflowIn the AOT, expand the Workflow node. Right-click the Workflow Categories node, and then select New Workflow Category. A new workflow category group displays under the Workflow Categories node. Right-click the new workflow category and then click Properties. In the Properties sheet, set the name and module properties.In the AOT, right-click MyWorkflowCategory, and then click Save. Workflow CategoryThe Workflow type is a building block that can be used to create customized workflows that enforce business policies.In Microsoft Dynamics AX, you enable the workflow process for a workflow document by creating Workflow types that are used in the workflow configuration user interface.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 In AOT->Workflow->Workflow Types->New Workflow type.Workflow TypeThe workflow document class that you create defines table fields for conditions in two ways: The Application Object Tree (AOT) query. The getQueryName method of the Workflow Document Class must be overridden to return the name of the query. Parameter methods. You can optionally add calculated fields by adding parameter methods with a specific signature on the class.Workflow Type(Define the workflow document)Microsoft Dynamics AX workflow uses events to initiate business logic in your application. For example, the workflow type has a property event handler for business logic when a workflow is started.Workflow event handlers in Microsoft Dynamics AX enable you to run application-specific business logic at key points during workflow execution. Workflow events are implemented at the workflow level and the workflow element levelWorkflow EventsEvent Description WorkflowStartedEventHandlerThis event raises when the workflow instance starts. WorkflowCompletedEventHandlerThis event raises when the workflow instance ends after it is completed. WorkflowCanceledEventHandlerThis event raises when the workflow instance ends after it is canceled. Use this event handler to perform any cleanup operations needed. WorkflowConfigDataChangeEventHandlerThis event raises when the workflow configuration data changes. Use this event handler to identify when a configuration has changed. For example, if you create an association between the application data and a workflow configuration, this event handler would raise if the configuration was deleted or updated. Workflow Level Event HandlersAt 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.Create a submitWorkflow and CancelWorflow menuitems.Set the object property of submitwork menuitem to the SubmitWorkflow class.Set the object property of CancelWorflow menuitem to the WorkflowCancelManager class.Workflow Menu ItemsIn Microsoft Dynamics AX, a workflow is started when 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 SubmitToWorkflow class.Workflow activation is added in the main method from the workflow type name.SubmitToWorkflow Class 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 dialog. 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 The elements of a workflow are created by you in the AOT and configured by application administrators. The workflow structure consists of sequences of workflow elements. An element can be a task, approval, or a sub-workflow.A task is a workflow element with a single step defined in the Application Object Tree (AOT) that is used to implement task-based processes. An approval is a specialized task that can have multiple steps defined in the AOT that is used to implement approval processes.Workflow elementsYou 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 ApprovalAssociate an Action Menu Item with a Workflow ApprovalAssociate a Display Menu item with a Workflow ApprovalCreate and implement event handlers on the workflow approvalCreate a Workflow ApprovalA 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 TaskAssociate an Action Menu Item with a Workflow TaskAssociate a Display Menu item with a Workflow TaskCreate and implement event handlers on the workflow taskCreate a Workflow TaskProperty Value WorkflowEnabledYesWorkflowDataSourceCustTableWorkflowTypeCustWorkflowEnable Workflow on FormIn the AOT, expand the Forms node. Expand the CustTable form, and then expand the Designs node. In the Designs node, right-click the Design child node, and then click Properties. In the Properties sheet, set the following properties. In the AOT, right-click the CustTable form, and then click Save. After the form is enabled for workflow, you will add a canSubmitToWorkflow method to the form. This method runs before the Submit button is enabled to verify that the workflow document is in a valid state to submit to workflow.Enable Workflow on FormIn Microsoft Dynamics AX, you can use workflow providers 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, or by which date an invoice payment is considered to be late. Workflow ProvidersHierarchy Assignment Determines a user ID based on a search in a hierarchy.Due dateDetermines the due date for a task or approval, or the due date for a step in a task or approval.ParticipantResolves a user group or role into one or more specific user IDs.Workflow Providers TypesDemo

Recommended

View more >