Try Microsoft Edge
A fast and secure browser that's designed for Windows 10
I've got a custom workflow which I have setup to be used with work item queues (i.e. I simply put [WorkflowDocIsQueueEnabledAttribute(true, "Quality Orders")] before the workflow document class. This allows the workflow to run fine however when I go to home/Work Items/ Work items assigned to my queues I don't see the workflows associated with the Quality order queues.
I think the answer has something to do with the WorkflowQueueCreatedEventHandler which should be creating records in the WorkflowQueueDocumentCommonFields table (this table is joined to when viewing the 'Work items assigned to my queues' page).
I've tried replicating the class PurchTableTaskCreatedEventHandler which extends WorkflowQueueCreatedEventHandler but this doesn't seem to work. When putting purchase orders into a queue I can catch breakpoints in this code but not when I do the same thing for my custom quality order workflow.
My knowledge on event handling is not that good. I'm not sure exactly how the system knows to trigger my particular class Can anyone tell me what else I'd need to do to trigger this event handler and run my custom class (essentially a duplicate of PurchTableTaskCreatedEventHandler) to populate the WorkflowQueueDocumentCommonFields?
Alternatively, I may be on completely the wrong track here and someone can point me in the right direction as to how to get my items to appear in 'Work items assigned to my queues'
Managed to work this out today. So the process for getting a custom workflow to cooperate with work items queues is:
1) First problem. The Quality Order document is not available for selection in the work item queue. See below.
To fix this we simply need an attribute on the workflow document class. i.e
[WorkflowDocIsQueueEnabledAttribute(true, "Quality Orders")]
class InventQualityOrderWorkflowDocument extends WorkflowDocument
Now we can create a work item queue based on this document.
2) As described in my original question I was not able to see my waiting work items.
1) After looking at the datasources on this form for quite some time I tracked it down to being a problem with the WorkflowQueueDocumentCommonFields table not getting populated. The population of this table occurs when the class WorkflowQueueCreatedEventHandler is triggered by the Work Items Created Event being setoff in the workflow.
The answer to this was to create the following class:
class InventQualityOrdeTaskCreatedEventHandler extends WorkflowQueueCreatedEventHandler
protected void mapFields()
dictClass = new DictClass(classNum(PurchTableDocument));
attribute = dictClass.getAttribute(#WorkflowDocumentAttribute);
inventQualityOrderTable = InventQualityOrderTable::findRecId(this.parmWorkflowWorkitemTable().RefRecId);
NB: This was based on classes\PurchTableTaskCreatedEventHandler.
This class extends WorkflowQueueCreatedEventHandler which in turn implements WorkflowWorkItemsCreatedEventHandler.
In order to trigger this event you must point the workflow tasks to the above class.
Find the task under AOT/Workflow/Tasks. Look for the property WorkItemsCreatedEventHandler. Put the name of your event handler in here. (in my case InventQualityOrdeTaskCreatedEventHandler).
Now this gets triggered when the work item is created, the WorkflowQueueDocumentCommonFields will be populated and the work items will show in home/Work Items/ Work items assigned to my queues
Hope this helps someone else in the future.
Thank you for this post David - it has taken a lot of guess work out of why the work items aren't being shown for our custom workflow.