if you are using DataGrid2, you should be able to walk the relationship from the Task entity to the Workflow entity and then to the Context entity.
I hope this helps
hello Shivam – have you found solution for this yet ?
I encountered the same issue in our Mendix app. Filtering on fields from the WorkflowContext seemed impossible when showing the WorkflowUserTask in a datagrid.
Our solution was to make a many to one association from the WorkflowContext to the Workflow object starting from the WorkflowContext. When the Workflow is called we use the output variable from the ‘Call Workflow’ action in a microflow to make the association between the WorkflowContext and the Workflow.
In our datagrids we show the WorkflowContext objects filtered by the following XPath:
[WorkflowContextObject_Workflow/System.Workflow/System.WorkflowUserTask_Workflow/System.WorkflowUserTask/System.WorkflowUserTask_TargetUsers = '[%CurrentUser%]']
[WorkflowContextObject_Workflow/System.Workflow/System.WorkflowUserTask_Workflow/System.WorkflowUserTask/State = 'InProgress']
Where the WorkflowContextObject is your own Context.
To show the user task we use a microflow that retrieves the Workflow object from our WorkflowContext and a retrieve WorkflowUserTask that constrains with the following XPath:
[System.WorkflowUserTask_Workflow = $Workflow]
[System.WorkflowUserTask_TargetUsers = $currentUser]
[State = 'InProgress']
If a UserTask is retrieved we assign it to the current user and show the UserTask page with the ‘Show User Task Page’ action.