Workflow Walkthrough – Infrastructure

12 01 2010

Ok. So far on this blog I’ve been covering bugs, tricks and other issues relating to Dynamics AX workflow. However I haven’t yet provided any formal walk-throughs of workflow in its entirety. So here is my opportunity to add something of which I hope will be real value when creating new workflow templates, configurations and setting up of the workflow infrastructure.

So lets start at the beginning shall we.

Basic Requirements for Workflow to Be installed

  1. Dynamics AX AOS with at least SP1 installed
  2. IIS server.
  3. .Net Business Connector (installation described during this tutorial)
  4. EP Licence (Not officially required, but needed for .Net Business Connector)

Step 1 – Workflow Website Installation

Before creating our workflow templates or configuring pre-existing DAX templates, we need to setup the workflow infrastructure including the Windows Workflow Foundation Framework, .net business connector etc, relevant system users and a number of configurations within AX itself. So first things first. Lets setup out Workflow Website containing Windows Workflow Foundation.

  1. Install Internet Information Services (IIS)
  2. Setup a default website on IIS
  3. Run the Dynamics AX server installation file on your IIS machine
  4. Select ‘Add/Remove Components’
  5. Select .NET Business Connector
  6. Click next.
  7. Select a Language for the .NET Business Connector.
  8. Click next.
  9. Click Finish when the .NET Business Connector has finished being installed.
  10. Run the Dynamics AX server installation file on your IIS machine again
  11. Select ‘Add/Remove Components’
  12. Select ‘Workflow’ (Ensure that your active Dynamics AX .NET business connection configuration on your IIS machine (previous steps) is pointing to the correct AOS as the setup wizard will need to connect to your AOS to make some changes)
  13. Click Next
  14. You will be requested to enter a username and password for the user that your business connector will use to login to your AX environment. If you have previously set this up in your environment, the username will not be available to change. You can later set this up in your environment by going to Administration -> Setup -> Security -> System Service Accounts
  15. Select your default website that you would like to add you Workflow Virtual directory/Application to. You can install this to your sharepoint site if you so wish.
  16. Click Next
  17. Select the system account that your AOS is running as, so that the setup wizard will add this user to the list of users allowed to access the workflow website
  18. Click Next
  19. Click Install
  20. Click Finish when the Workflow Installation wizard has finished.

Your workflow infrastructure should now all be ready.

Should you wish to have multiple AOS environments all running Workflow, but only 1 IIS server, see this post for more details.

Step 2 – Configure your AOS

  1. Login to your Dynamics AX Environment as and administrator User.
  2. Ensure that your email server parameters are correctly setup (Administration -> Setup -> E-mail parameters)
  3. Setup your System Service Accounts (Administration -> Setup -> Security -> System Service Accounts)
    1. Business Connector Account (account used to login to your workflow website and other external tools)
    2. Workflow System Account
    3. Workflow Execution Account
  4. Setup a batch server (Administration -> Setup -> Server Configuration)
  5. Setup a workflow batch group (Administration -> Setup -> Batch Groups), give it a name like WF or WORKFLOW
  6. Run the workflow infrastructure configuration wizard (Administration -> Setup)
    1. In the first screen click Next
    2. Enter the full Workflow Website address that you created above if not already populated
      1. E.G. http://MYSERVER:80/MicrosoftDynamicsAXWorkflow50
    3. Click Validate, you should get a message such saying ‘Workflow runtime URL is valid’ if not you have not setup either your business connector account successfully or the workflow website is not functioning properly.
    4. Click Next
    5. Select the batch group that you created above (this is for the message processing batch job)
      1. If this is greyed out, you can cancel the batch the wizard and go back and delete your already existing workflow message processing batch job)
    6. Click Next
    7. Select the batch group that you created above (this is for the expired workitems batch job)
      1. If this is greyed out, you can cancel the batch the wizard and go back and delete your already existing due date workflow batch job)
    8. Select a recurrence time for how often you want workflow to check for expired workitems, by default this is every hour.
    9. Click Next
    10. Click Next to confirm, this will create the necessary batch jobs for workflow workitem processing as well as due date checking.
      1. To confirm that the batch jobs were create you can check under (Basic -> Enquiries -> Batch Job). There should be 2 new batch jobs created and in a waiting state (“Workflow Message processing” and “Workflow Due date expirations”)
  7. Setup your workflow per company
    1. Setup Workflow Email template (for workitem assignments) (Basic -> Setup -> E-mail Templates)
      1. Create a new Email template and name it “Workflow” or something similar, select default language and the name of the user that you want to appear in the Sender and Sender address fields in the email when the user receives a notification about new workitem)
      2. Create at least one language template, select a subject and provide the necessary contents for the email by clicking on the template button. You will be able to provide both a text as well as an HTML based template.
      3. You can use a number of ‘tags’ with in your template (and email subject) that will allow you to open and link to the correct notification or record within AX, or simply display more information about the workitem that the user is being emailed about. E.G:
        1. LinkToAlert%/”>View Alert (in the html editor)
        2. LinkToBusinessData%/”>View Record (in html editor)
        3. %Subject% – Displays the subject of the workflow (from WF Configuration)
        4. %Message% – Displays the instruction of the workflow (from WF Configuration)
    2. Setup number sequences (Basic -> Setup -> Number Sequences)
      1. Create number sequences that will be used for your configurations as well as for your actual running instances
      2. E.G.
        1. Configuration Number sequence:
          1. Number Sequence Code: Work_200
          2. Name: Work_200
          3. Smallest: 1
          4. Largest: 999999
          5. Next: 1
          6. Format: ######_200
        1. Instance Number sequence:
          1. Number Sequence Code: Work_201
          2. Name: Work_201
          3. Smallest: 1
          4. Largest: 999999
          5. Next: 1
          6. Format: ######_201
    3. Setup company (for each company) workflow parameters (Basic -> Setup -> Settings for Workflow)
      1. On the first tab select the email template that you have just created (Approval and task notifications)
      2. On the second tab (Administration), your workflow runtime (website) url should already be selected.
      3. On the third tab (Number sequences),  select number sequences created above for:
        1. Configuration Id Work_200
        2. Instance Id Work_201
      4. Close the settings for workflow screen
    4. You company/companies should now be all ready for you to begin developing or configuring workflows.

Keep your eyes open for the Workflow walk-throughs on Configurations and Template developments. Please let me know if you have any further comments or tips that you have discovered during workflow infrastructure configuration.

Enjoy Workflowing

Further reading:
Workflow Installation and Configuration

About these ads

Actions

Information

47 responses

29 01 2010
Stevanus HK

Nice tutorial, do you know how to set ax if i want to send an alert to email for workflow alert?

29 01 2010
Jonathan Halland

Hi Stevanus, you just need to ensure that you have setup a email template as in the tutorial and then switch on each user’s email alert option. Administration -> Users -> User Options -> Notifications -> Send notifications as email messages. This will set user to whom the workitems are assigned to get alert emails.

6 04 2010
phil

Is there a way to fix the e-mail alerts to redirect to the correct company that the alert originated from? We have the problem where alerts are created in one company but if the user’s default company is different the drill-down link wont work.

7 04 2010
Jonathan

Hi Phil

The alerts in Dynamics AX keeps a link to the company from where they were generated (eventinbox.CompanyId). If you use the drill-down hyperlink functionality in your emails (e.g. dynamics://1?DrillDown_133/ ) it will take you to the form that you specified in your workflow with the correct company being set for just that form.

I tested the drill down links again now to confirm that this is indeed the case. I did however notice that for certain alerts like an alert I recieved for a Workflow Website Service failure it did give me an error when using the drill-down functionality as there was no source record for it to try and drill-down to.

I hope this helps a bit.

Regards
Jonathan

6 05 2010
Tim

Useful guide for a first configuration. Many Thanks Jon.

21 07 2010
ahmad shafout

i’m able to make submit only …. but the workflow history appear that there is no assignment and the task is pending …….

please help

22 07 2010
Jonathan

Hi Ahmad. According to the workflow history, has the work-item been created and simply not been assigned or does the history only reflect that the workflow has been initiated? Sometimes the history will reflect the workitem being created but not assigned if the configuration that you have set-up does not manage to resolve at least one or more users. E.G. If you have selected to assign the workitem to a user group but there are no users setup in that group.

24 12 2010
Ahmad.Shafout

Hi Jonathan

thanks for your replay …. the problem solved it seems it’s related to system accounts setup … we change the system user account to new one.

thanks a lot ….

8 11 2010
Siddhartha Indra

Hi,
I am facing an unique problem. The workflow batch jobs are stand still in “waiting” status, hence for all the workflows no work item is getting created. However on running the tutorial, the workflows are running fine. It seems that workflow is fine but there is some problem related to batch jobs.
Can you suggest a possible cause and remedy?

8 11 2010
Jonathan

You may want to check that the batch group linked to your batch jobs is pointing to the correct AOS and that the server is marked for batch processing.

10 12 2010
How to run multiple Dyanamics AX workflow websites on IIS 7 « Dynamics AX Workflow Wanderings

[...] For more information on setting up your workflow infrastructure in dyanmics Ax 2009 check out this post. [...]

28 03 2011
asiq

Hi,
Thanks for useful info. What is the tag for displaying who has created the alert..say the one who modifies a field in form.

14 09 2011
Lauren

In step 6 you refer to the workflow config wizard, what if you need these two workflow batches to run in multiple companies?

14 09 2011
Jonathan

The batch processor processes all workitems across companies.

14 09 2011
Lauren

I figured that since a company id was assigned to the batch that it would not be virtual.

15 09 2011
Jonathan

Yeah, I’ve been confused by that too. But the job itself is cross-company.

27 09 2011
Tyler Lee

If we do not have EP license, shall we be OK to install and run workflow for Purchase Requisition? Thank you!

27 09 2011
Jonathan

From our experience you will not be able to. I haven’t got an official word from Microsoft on this, but the EP licence enables the Business Connector User component which Workflow requires.

2 03 2012
Ana

Hello

I am having issues creating a stop conditon

I tried employee.line manager level = 1. It seems that default is 0 so when I put 1 it does not save

if I don’t put a stop condtion at all using hierarchy based, I get an error message

8 03 2012
Jonathan

Hi Ano. One needs to specify a stop condition so that workflow knows how far up a hierarchy it goes before it stops. E.G. Finding a manager who actually has sufficient limit to approve a record. Can I ask what workflow you are using?

13 03 2012
Ana

Hello

I am trying to use TRvDocumenttemplate for the expense Management module

Thanks

Ana

15 03 2012
Jonathan

Hi Ana. Are you experiencing any specific issue or do you have a question that I can assist with?

27 03 2012
Ana

Hi Jonathan

yes the issue I am having is that I am using hierarchy based asigment but the workflow only goes to my manager and then if my manager does not approve it within 1 hour, expense report gets automatically rejected. I was expecting it would go to the next level of manager.

It is probably a setup issue within the configuration but I am not sure where.

I hope you can help

27 03 2012
Jonathan

Hi Ana. We have had the same type of need in the past, unfortunately there doesn’t appear to be any form of escalation that progress one step at a time indefinitely until it reaches the top level of approval.

We ended up coding our own hierarchy provider always went only one level up and then stopped. We then had a pre-defined number of escalation levels in our configuration e.g. 5. If we got to the top level before the five levels of escalation were reached we simply kept assigning it back to the same user.

Kind Regards Jonathan

30 03 2012
Tunji

Hi Jonathan,
I have comfortably setup workflow which is operational on a company account. The company as requested for new company account creation in addition to the old company account. All other job done successfully but do not have an insight on how to setup workflow on the new company account.
I tried migrating the workflow setup on the old account into the new account, but workflow operations are still pointing to the old company account. could u pls offer a step-by-step way out.
Pls, reply via this channel or my mail address.
Thanks

30 03 2012
Tunji

Hi Jonathan,
Another challenge agian.
Created a new company account in Ax 2009 and has successfully migrated relevant modules into the new company account. However, the Address table does not populate despite migrating the relevant table extended to address table. Could u pls offer an insight into solution?

30 03 2012
Ana

Hi Jonathan

Thanks for your quick reply

Now I know that it is not possible to escalate

I have a question regarding email template

If I need the user who submited the expense to get an email when an item has been escalated, approved, rejected or returned, do I need to setup a template for each.

Thank you so much

3 04 2012
Jonathan

Hi.

You will need to setup notifications for these actions within your workflow configuration. Let me know if you would like me to post a how-to on setting up these notifications.

Regards Jonathan

10 04 2012
Ana

Hi Jonathan.

Would you mind posting the how to on setting these notifications.

Thanks again for your help.

11 04 2012
Jonathan

Hi Ana. I actually created a video yesterday for a client and have now posted a it on my blog over here: https://workflowax.wordpress.com/2012/04/11/setting-up-notifications-on-approvals/ I hope that helps a bit.

11 04 2012
Gary Knue

Hi Jonathan.

I am so close to having workflows for purchase requisitions installed and working. I can submit a purchase requisition, my boss gets it and approves it but when I look in the Workflow history Tracking Details I see that the Approval completed but then this message – Workflow stopped (error). It doesn’t give me any more information than that.

Any ideas on why the workflow has stopped?

Thanks,
Gary

12 04 2012
Jonathan

Hi Gary. My thoughts on the matter:
1. Check you event log on both your AOS box and your IIS (workflow website box). Quite often there are more descriptive messages over there.
2. In your accounts payable parameters, do you have the setting to enable automatic purchase order creation enabled? If so try run your tests without it enabled and see if workflow completes and if so do you get any errors when you manually try and convert the PR to a PO. Quite often there is some details about the PR that is preventing conversion. E.G. No vendor filled in or invalid vat combinations etc…

I hope this helps a bit.
Kind Regards
Jonathan

12 04 2012
Gary Knue

Jonathan, you are the man. We did have the setting to enable automatic purchase order creastion enabled. I set this value to No and resumed my workflow and it completed. I had spent many hours trying to fix this when I found your blog. I have this site in my favorites so it’s the first place I’ll look if I have any more problems with workflows.

Thank you so much,
Gary

12 04 2012
Jonathan

I’m glad I could be of assistance. :-)

12 04 2012
Gary Knue

Jonathan, I did run into another problem while testing a multi-level approval purchase requisition. I had one of my employees submit the requisition, it went to his boss for approval, his boss approved it and it went to another supervisor because the amount was over his boss’ limit but under the supervisor’s limit, since it was a test the supervisor clicked to reject it and he got the following error: Work item could be created. Insufficient rights for user XXXX where XXXX is the user that originally submitted the requisition. Do you know what permissions the user that submitted the requisition needs for this to work? Has it got something to do with sending the rejection email? Notifications for Reject are enabled.

Thanks again,
Gary

13 04 2012
Jonathan

Its most likely the ‘Resubmit’ button security permissions. You can find the permission under “Accounts Payable -> Miscellaneous -> “Submit”, PurchReqReSubmit”

13 04 2012
Gary Knue

Jonathan, once again you are the man. Granted Full Control to this security item and the Reject worked. Do you know of a good document or link that details the security settings for each workflow group? For example, we have an employee group that allows users to submit purchase requisitions, an approval group that allows supervisors to approve them, and a completion group that allows users to create the purchase order.

Thanks again for all your help. I really appreciate it.
Gary

14 06 2012
saptarshi

Hi Jonathan,

For a client we have a complex Distributed Server Architecture as the client is having 9000 ep licenses.

All the installations have gone fine but for workflows we are facing a strange. When we are running workflows we are getting the following error:

Stopped (error): Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics.
Stack trace: Binding operation failed to allocate buffer space.

(S)\Classes\SysWorkflowHelper\workflowRunAs – line 37
(S)\Classes\SysWorkflowEventDispatcher\dispatch – line 131
(S)\Classes\SysWorkflowMessageQueueTask\run – line 21
(S)\Classes\BatchRun\runJobStatic – line 63

Uninstallation and installation did not help. The same error is occurring for admin user as well.

The error is completely erratic and is not being replicated every time. Again on resuming the stopped workflows it is working fine

Will request your advice on this.
Application is AX 2009,SP1 and RU7.
Regards
Saptarshi

14 06 2012
Jonathan

Hi.

Please check that the users who are meant to be assigned these workitems are enabled in the users form under administration

14 06 2012
saptarshi

Hi Jonthan,

They are all enabled and are already accessing the system.

Thanks and Regards
Saptarshi

15 06 2012
Amith Prasanna

Hi,all ,
Please tell me whether if there any method to get workflow approval via ,Work flow notification mail it self??

18 06 2012
Jonathan

We offer a product that accomplishes this for you http://merpi.axnosis.com/emailer.php

22 06 2012
JIya

HI Jonathan,

I have following two problems in work-flow for purchase requisition,

1.) My work-flow is getting successfully implemented in one company which is shown in Batch-job’s but when i configure in other company it is not working. It work’s only in the company which is shown in batch-job’s. Also while automatic configuration of work-flow. i am not able to select the Batch-Group it comes by default.

Why so?

2.) when i click the work-flow history form and by clicking on the filter by status combo-box the system get’s hanged and have to forcefully close- it down. Debugged the code for the same but show’s no error.

Thank’s for the help in advance

19 02 2013
Gary Knue

Hi Jonathan,

You assisted me in getting workflows to work about a year ago and everything has been working flawlessly until last week. Our users can submit the purchase requisition but when I go to Basic->Inquiries->Workflow history I see them sitting in Pending status. I don’t know of anything that has changed. I reviewed our posts from early last year but can’t seem to figure this out. Any ideas?

Thanks,
Gary

19 02 2013
Gary Knue

Jonathan,

I did find the following error on the IIS server:

Workflow instance: 00b7cf8e-3261-43d2-bfb6-6f847b99b5e8 was terminated for the following reason: Dynamics Adapter CallStaticClassMethod failed..

I hope this helps.

Gary

11 03 2013
jzeng

Our company Business analyst just found re-assign work item sucessfully to a employee, who limit is less than PO requisition amount.But when firstly submit original PO, it would stop by employee limit. So only re-assign a stopped work item, and pick any employee, it will go out unexpectedly..

Do you know how to stop re-assign a work item to limited employ? or is our work flow configuration wrong? we use posistion hierachy in po requisition workflow configuration.

thanks in advance for any help.

12 03 2013
Jonathan

Hi

There are two places that you can re-assign a work-item. 1. From the actions menu on your PO requisition form 2. From the workflow history form.

For the first option you can normally just disable that menu-function in your security groups to prevent the user from re-assigning. For the second option, i believe it is only users in the “Administrator” group who can use the re-assign function.

Kind Regards Jonathan

On Mon, Mar 11, 2013 at 11:16 PM, Dynamics AX Workflow Wanderings

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

Join 254 other followers

%d bloggers like this: