AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.10.2010, 22:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
workflowax: Workflow Wishlist #2 – onDelegateEvent
Источник: http://workflowax.wordpress.com/2010...delegateevent/
==============

Wish:
The second item on my wishlist for Dynamics AX workflow is to have an “onDelegateEventHandler” option available for tasks and approvals. I must admit that this would most probably not be a very widely used function within AX workflow, but here is why I would like to have one.

Given the way that workflow manages the assignment of workitems, there is no way of determining when and to whom tasks are assigned to people, in order to perform some type of custom action like updating an external system or table. Even making use of custom ParticipantProviders, one does not have a guarantee that it will end up at the person that your provider class is returning, due to delegation settings.

Thus an onDelegate event handler would be very useful. Unfortunately workflow does not have any eventhandlers for individual workitems, rather just set on tasks, so this may be difficult to accomplish.

My workaround:
It is relatively easy to tap into the WorkflowTrackingTable’s (Table) saveTracking Method and kick off some custom action using the record ‘trackingTable’. The trackingTable record contains a useful field  called TrackingType (enum WorkflowTrackingType) which can provide you with more informations as to what has just occurred. E.g. WorkflowTrackingType::Delegate, WorkflowTrackingType::EscalationPath, WorkflowTrackingType::Creation. Using this you can then perform whatever action you would like to do e.g.

if (trackingTable.TrackingContext == WorkflowTrackingContext::WorkItem) {   if (trackingTable.TrackingType == WorkflowTrackingType::Creation)   {         doAction(trackingTable.User); //this is the user to whom the workitem has finally been assigned    }   else if ((trackinTable.TrackingType == WorkflowTrackingType::Delegation) || (trackingTable.TrackingType == WorkflowTrackingType::EscalationPath))   {        doAction(trackingTable.ToUser); //to whom the workitem is now assigned (delegated/escalated) } } N.B. Be warned, you are modifying system classes so be careful when you are installing new hotfixes or upgrading.
Happy Daxing
Comments Suggestions?
Workflow Wishlist:
#1. canApprove / canReject Logic
#2. onDelegateEvent



Источник: http://workflowax.wordpress.com/2010...delegateevent/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
workflowax: Workflow Wishlist #1 Blog bot DAX Blogs 0 27.09.2010 20:06
workflowax: Why is my yellow workflow bar not displaying Blog bot DAX Blogs 0 20.09.2010 12:05
workflowax: Calendars in Workflow Blog bot DAX Blogs 0 10.06.2010 16:05
workflowax: What is a workflow owner used for? Blog bot DAX Blogs 0 01.06.2010 15:05
workflowax: Enabling Workflow Configurations for different modules Blog bot DAX Blogs 0 23.05.2010 08:06

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:03.