In AX2009, I'm having trouble understanding the different workflow events and when they are triggered.
My information source is http://msdn.microsoft.com/en-us/library/cc588240(v=ax.50).aspx
I'm unable to find the answers in the Microsoft documentation, or on the internet.
I know there are basically 4 WorkflowElement outcome types:
| AOT name in case of | AOT name in case of |
Outcome Type | Task | Approval |
Complete | Complete | Approve |
Return | Return | Reject |
RequestChange | RequestChange | RequestChange |
Deny | Deny | Deny |
In the AOT, there are properties on workflow and its elements to enter the EventHandlers.
LEVEL | Object property |
Workflow | CanceledEventHandler CompletedEventHandler ConfigDataChangeEventHandler StartedEventHandler |
WorkflowElement (Task/Approval) | CanceledEventHandler StartedEventHandler |
WorkflowElementOutcome | EventHandler |
In case of the Element Level event handlers, I'm confused.
This is where I think the EventHandlers should be entered:
Event | On WorkflowElement properties | On WorkflowElementOutcome properties |
WorkflowElementStartedEventHandler | yes |
|
WorkflowElementCanceledEventHandler | yes |
|
WorkflowElementCompletedEventHandler |
| yes (type=complete) |
WorkflowElementReturnedEventHandler |
| yes (type=return) |
WorkflowElemChangeRequestedEventHandler |
| yes (type=requestchange) |
WorkflowElementDeniedEventHandler |
| yes (type=deny) |
What is the difference between a Denied and Canceled?
When you Cancel a workflow, does that first trigger the Deny on the WorflowElementOutcome, and then the Cancel on the WorkflowElement?
Also, the documentation mentions: (note with Element Level Event Handlers)
The Return and ChangeRequested events share the same state in the recommended workflow state model. You can implement these two different events to distinguish between a workflow that is returned and a workflow that only needs a change. However, in both events, the behavior is the same in that a work item is created, and after the work item is complete, the document state is returned to Started.
I'm not sure what they mean here by "document state". Do they refer to the "Workflow State" mentioned in "Approval State Transitions" (http://msdn.microsoft.com/en-us/library/cc604518(v=ax.50).aspx)?
If so, there's no state "Started".