Best practice for showing WorkflowContext info in a WorkflowUserTask datagrid?

0
My questions is as follows:   In a Datagrid(2) showing WorkflowUserTasks, what is the most effective way to show data related to the WorkflowContext?   Here are some possible solutions and their downsides in my opinion: Use the "Retrieve workflow context"-block in a Dataview This can result in big performance issues. The "Retrieve workflow context"-block always does a Database call. In the setup in the figure below, this would mean (3 tabs x let's say 3 columns x all rows in all datagrids) amount of Database call when the page is opened. Also, the added data columns are not searchable. Change the datagrid to a specialization of UserTaskView from the WorkflowCommons module. Add an association to the WorkflowContext and retrieve over association to show data. I have seen this used in a few apps. This seems not ideal because you would be misusing objects used primarily for history documentation directly in the front-end of the app. This is not scalable, because that would result in lots of associations to the UserTaskView specialization that are only filled in a particular task and stay empty in the other tasks. The data is searchable however. Add a cross-module association from WorkflowUserTask to a TaskInfo object. Initiate the TaskInfo object in the OnChange State Change flow of the Workflow. Here you would be able to use the "Retrieve workflow context"-block without performance or DB overwrite issues. This seems the most clean option. You would however need to update the TaskInfo object if the WorkflowContext attributes it is base on change. Cross-module associations with the system module are always 1-*, so the info would still not be searchable. Am I missing a solution? What do you think is the best option?  
asked
1 answers
0

Sander,

Good question!

 

I have used the third option in most of my workflow implementations.  This provides me with the ability to quickly and easily retrieve workflow information from workflow context objects, which seems to be something that is a common requirement in workflow related applications.  For instance, if my workflow context object is an invoice that is approved for payment via a workflow, it seems that finding out the approval status and history of that invoice is something I would want to do often.

 

One note:  I usually create the association between the workflow context object and workflow and/or user task view objects as those are the history objects for a workflow.  Workflow and UserTask objects only exist if a workflow is currently executing.  WorkflowView and UserTaskView exist both while the workflow is executing and after it is complete.

 

Hope that helps,

Mike

answered