Why does Retrieve Workflow Context Require both Workflow Object and The Workflow itself

0
Hi Community Members,   I am currently exploring the Mendix Built-in Workflow and seeking deeper insights into its functionality. Specifically, I am interested in implementing Pre-UserTask (User Task Started) and Post-UserTask (User Task Ended) event handlers to associate certain user tasks with the context entity for easier development. Our goal is to display detailed information about the workflow context entity in the inbox, rather than just showing the User Task Entity itself.   However, I have noticed that when retrieving the workflow context, it is necessary to provide not only the workflow object but also the workflow from the App Explorer to access the context. I initially thought that the Workflow object or WorkflowDefinition object alone would be sufficient to locate the workflow or obtain metadata.   I have been searching through the library but have not found any information on how to retrieve the workflow context at the code level.   Could anyone with more experience in workflows share their insights on this?
asked
1 answers
0

Hello Chen,

you're right; retrieving the workflow context in the event microflow of "User Task Started" requires both the workflow and the workflow object. The workflow object is not available at this time.

 

However, going back to your request to display context details in the inbox, why don't you use the following solution:

On the page "TaskInbox_xxxx", add an additional column that shows a snippet. That snippet is a dataview of your context entity. image.png

answered