Browsing all articles tagged with Workflow Archives - Amer Atiyah, Microsoft Dynamics 365 Blog
22

I have faced this error twice, I sloved it the first time by “Enabling the 32-bit Applications” on the application pool level of the workflow.

But in another time the installation was on Windows 2008 R2, and this made things harder. Enabling the 32-bit Application did not solve the issue. This actually happened because of the conflict in this Windows between the .NET framework 2.0 and .NET framework 4.0. It also might be caused of an authentication issue, so you better check that all one by one to get this validation problem resolved.

To solve the issue, I basically have gone through these steps: (of course I followed those steps after installing the workflow and I did not uninstall it)

  • Deleted the application from the IIS (the selected node in the picture below).

  • Added a “Virtual Directory” to the same site and named the new virtual directory with the same name of the deleted application.
  • In the physical path of the virtual directory, I pointed to the installed worklfow folder (most probably will be in “C:Program FilesMicrosoft Dynamics AX50Workflow“). This folder contains the web services of AX workflow.

  •  Then, I converted the new “Virtual Directory” to “Application” by right-clicking that directory and clicking “Convert to Application”.
  • I went to permissions of that application, by clicking (selecting) the “Applicaiton” you have just converted and double clicking “Authentication” and I insured that “ASP.NET Imporsenation” and “Windows Authentication” are enabled and any other things are disabled.
  • (Optional) You might disable the Kernel-mode authentication for the Windows Authentication by clicking the “Advanced settings” for the Windows Authenticaion. You cannot do that if if you have a kerberos authentication configured in your environment, if not.. then you better disable it to improve your environment performance.
  • I then went to the “Handler Mapping” of the Workflow Application. I selected “WebServiceHandlerFactory-ISAPI-2.0” and then clicked “Edit”. I insured that the “Executable” path is pointing to the .NET framework version 2.0 32-bit. (Note that this Windows contains on two versions of framework handlers and in two different folders inside the “C:WindowsMicrosoft.NET” folder.) In our case, you always have to point to the “aspnet_isapi.dll” file in the “Framework” folder not “Framework64”.

By this, you will be able to browse anyone of the *.asmx files in the Workflow Application. Also you might validate your workflow configuration.

Hopefully it has been resolved to you as well. :)

362

As I have mentioned in an earlier post, to get my life easier with developing new Dynamics AX Workflows I have created an easy to use wizard that generates AOT objects for one Approval workflow in Dynamics AX 2009, without writing a single line of code. I have used this wizard since more than a year to develop all the workflows that I had to develop.

I have been asked many times by Dynamics AX technical and functional consultants to share that with them. And here I am sharing it with the Dynamics AX community.

By following three steps, Dynamics AX Workflow for Dummies simply:

  1. Adds a Workflow Template
  2. Adds a Workflow Category
  3. Adds a Workflow Approval
  4. Adds a workflow state field to the selected table
  5. Enables the workflow for the selected form
  6. Creates needed classes like the document class for the workflow document
  7. Creates a query (Workflow Document)

Here are the steps that you have to follow: (pictures speak quietly)

Wizard menu

Welcoming message

General information

Generated AOT Objects Parameters

Generated AOT Objects Parameters

Generated AOT Objects Information

After clicking Finish, you would get a Dynamics AX Project:

Workflow Project

Generated AOT Project

In order to configure the generated Workflow template, go to the module that you have selected in the wizard, and open the Workflow Configuration under the Setup menu of that module. This is what you will have:

Workflow Configuration

If you are interested to have it, just comment on this post and write me your email or send me an email to amer@amerax.net and I will be more than happy to send the project to you.

I also would welcome any feedbacks on this. :)

3

A question might come to your mind, what’s the difference between a Dynamics AX 2009 Workflow Task and a Workflow Approval in AOT. They both are having almost the same properties and you could attach them to a workflow template.

Workflow in AOT

The workflow in Microsoft Dynamics AX 2009 is managed in a way that enables the workflow designer (who does the workflow configuration, a functional consultant in most of the cases) divides one “stage” approval into multi steps.

For example, if a Leave Request needs to be approved by the HR department, then the case might be in a way that approval must be processed by an HR Assistant and NOT the HR Manager in case that the leave does not exceed three days. But if the Leave Request is for more than three days… the HR manager must approve it also.

To enable this scenario, the workflow should be fixable so that the workflow designer is able to add as many steps per one approval “stage” as he likes. This is done by adding a Workflow Approval to the Workflow Template. When you go and configure this workflow template in the Workflow Configuration, you will be able to add as many steps as you wish… and you could also configure each step by specifying who this step will be assigned to and in what condition. And the workflow approval stage will not be completed unless all the steps are completed.

Now for the Workflow Task, this cannot be done. A Workflow Task represents only ONE STEP of a Workflow Approval. The workflow designer cannot add steps to this Task; he only could assign a person and a condition for this step/task. Task is nothing but a single unit of work.

The following image describes what I said:

Task and Approval in Dynamics AX 2009 Workflow

Another differnce is that a a task does not have a fixed outcome. However, you can add any number of custom outcomes to the task, such as Completed or Skipped.

9

When you install Dynamics AX Workflow, you might install it on a different machine that the AOS, like a web server for example. In this case, you have to install the following on the workflow server to get your workflow works:

  1. IIS
  2. .NET Business Connector
  3. Create a new website on IIS (do not use the same of WSS or EP websites, it is recommended not to use an existing website even)
  4. Workflow

Before going into step number “4”, you have to configure the “System service accounts” in: Dynamics AX –> Administration –> Setup –> Secuity. Fill these fields like the following:

  • Busienss Connector Proxy: create a domain account and assign it here, this user doesn’t have to be a Dynamics AX user.
  • Workflow System Account: Select a user like the Administrator  from the drop down list
  • Workflow Execution Account: like the previous step

Now you should be able to go through the step “4”, and install the Workflow component.

After installation, go to Dynamics AX –> Administration –> Setup –>Workflow insfrastructure configuration wizard. If you are getting an error after installing Dynamics AX Workflow: “401 Unauthorized”, then insure that you go through the following:

  1. AOS Service is running under an active domain user (domainusername)
  2. Workflow website and workflow application pool are having the same .NET Business Connector user name Identity (and of course, this should be an active domain user)
  3. You added the workflow website (http://servername:portnumber/DynamicsAXWorkflow50 for example) to the trusted sites in Internet Options of AOS server
  4. Run the following on the Workflow server:
    • Start a command prompt.
    • Locate and then change to the directory that contains the Adsutil.vbs file. By default, this directory is C:InetpubAdminscripts.
    • Type the following command, and then press ENTER:

cscript adsutil.vbs set w3svc/NTAuthenticationProviders “NTLM”

    • To verify that the NtAuthenticationProviders metabase property is set to NTLM, type the following command, and then press ENTER:

cscript adsutil.vbs get w3svc/NTAuthenticationProviders

The following text should be returned:

NTAuthenticationProviders       : (STRING) "NTLM"

 

By this, workflow infrastructure configuration wizard should work fine now. :)

0

Workflow in Dynamics AX 2009 is interesting technical part of this lovely product. When you try to develop/create a new workflow in Dynamics AX you might get confused of the so many menu items and classes that you create, and sometime you don’t even know what these classes’ handlers and menu items are used for. That’s why when I first learned how to create workflow in Dynamics AX one year ago; I created a pretty easy-to-use wizard that creates for you a workflow with all the necessary objects like Workflow Template, approval, category, classes and menu items. Furthermore, this wizard enables the workflow on the selected form and its main table.

One of the important classes that you need to set at the approval process is the participant provider. The goal of this property is for the workflow to decide who will be the participant user for this step of workflow. To do that, you have to extend WorkflowParticipantProvider class and overwrite the methods: getParticipantTokens that fills the list of options in the Role Based section of and resolve that will decide the exact user based on some X++ and the selected option in Role Based list.

Dynamics AX 2009 Workflow - Assignment - Role based

Dynamics AX 2009 Workflow - Assignment - Role based

By default, Dynamics AX 2009 comes with three participants:

  1. WorkflowUserGroupParticipantProvider:
  • List all configured User Groups in the system and assigns the workflow step to all users in the selected group
  1. ProjWorkflowParticipantProvider:
  • This is for Purchase Requisition workflow. List some tokens like Project Manager, Project Controller, Project Sales and others and assigns the workflow step to the assigned person of the Purchase Requisition project.
  1. TrvWorkflowProjParticipantProvider:
  • This is for Expense Management workflow. List tokens like Project Manager, Project Controller, and Project Sales and assigns the workflow step to the assigned person of the expense project.

 

Workflow Approval Properties

Workflow Approval Properties

So simply, when you need to specify participants based in your criteria, you need to do exactly the same of those classes, by overwriting getParticipantTokens and resolve.

0

A very nice article has been posted in MSDynamicsWorld.com by Scott Hamilton about workflow in Microsoft Dynamics AX 2009. It shows by more than one example how workflow could be effectively implemented so it serves organization processes needs.

This article is excellent for those who haven’t experienced the workflow yet in Microsoft Dynamics AX 2009. It doesn’t require any technical background.

Have fun.

1

Microsoft has added a very useful functionality in the new release of Microsoft Dynamics AX 2009 that is: Workflow. I have explored many articles by Microsoft and others about Workflow in Microsoft Dynamics AX 2009. For the technical articles part, all of them are describing the workflow in a technical format that prevents the reader from seeing the whole picture of this functionality that has been delayed a lot. This is so important to be known.

Microsoft did not implement the workflow inside Microsoft Dynamics AX itself, they preferred to use WWF (Windows Workflow Foundation) that has been released with the .NET Framework 3.5.  WWF is a new feature that builds and executes workflows inside .NET applications. WWF workflow engine, the one that runs the workflow inside Microsoft Dynamics AX 2009, is published and configured in the IIS.  The following diagram shows you how this happens:

Workflow engine in Microsoft Dynamics AX 2009

Workflow engine in Microsoft Dynamics AX 2009

By this, Microsoft has gained the advantage of the new functionalities that would be added later on WWF without upgrading Microsoft Dynamics AX itself (for most of the cases at least).  And this is a great example of what you can do when using .NET business connector of Microsoft Dynamics AX.

In the following picture, you could see that workflow runtime, currently, is residing inside IIS.

Microsoft Dynamics AX Workflow Runtime

Microsoft Dynamics AX Workflow Runtime

Someone might ask: why did’nt Microsoft lunched the workflow runtime on the AOS of Dynamics AX.  Actually Microsoft is planning to do so in the soonest (this might be in Microsoft Dynamics AX 2010). But they have made it on IIS because the AOS is written in a native code, not in a managed code.  And since WWF is part of “very managed” .NET environment, it’s time and effort consuming for them to make such integration. So they simply put the workflow runtime on the IIS till they completely convert the AOT into managed code.

You guys could benefit from a video that has been recorded in PDC 2008. Josh Honeyman, a Senior Development Lead at Microsoft, shows how workflow is implemented in Microsoft Dynamics AX 2009 and its future. To watch the video, press here.

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Mohammad A-Awami, Dynamics AX Specialist at WorleyParsons

    AlAwami"I worked with Amer for WorleyParsons. I found him very cooperative. He is able to help me in a lot of issues that related to ax. His ability to solve the problems is fascinating me. It is so fast and done on the best practice. His ability on business analysis and implantation are done on the best methods."

  • Read more testimonials »