MX 9.1.1: Workflow: How can I find the instance of the previous task?

0
I need to know the user who actually executed a user task. For that I have a microflow step after the user task. In that microflow I need to find the instance of the user task just completed and read the assignee. In the simplest form I query all instances of user tasks for my workflow instance and check the one completed the last. However, if I have workflow with parallel splits, this algorithm won’t necessarily give me the right answer. The only way to get the correct answer is to navigate back from the current instance of the workflow task to the previous and so on until I hit a user task. However, I do not seem to see a way to know the instance of a workflow task which was executed before the current one. Can somebody help me?
asked
3 answers
0

Hi Miroslav samoylenko,

I am new in mendix But as per my knowledge Workflow has some entities defined in System Domain model and “WorkflowTaskInstance” entity maintain the instance of user task or creates new instance whenever new task is running .so i think by using that entity you can get the help of current task instance.

I hope this will help you.

answered
0

Hi Miroslav,

 

Interesting question. Could you please take a look at the DS_UserTaskTimeline microflow in the Workflow Commons module to see if you can get some inspiration there? I’m not sure if that will solve your problem with the parallel splits though. If I understand it correctly, you want to get the user that executed the previous user task in the same path of your parallel split, regardless of when it was actually finished? In that case, could storing extra information on your Workflow Entity be an option? When the user finishes a task, call a microflow that keeps track of who performed the action on your entity, and complete the task in that microflow rather than using the client action on the button.

answered
0

Hi Miroslav and all,

For me a missing option in the workflow is that the user who executed a task is not stored, for me the assignee means something else and doesn’t have to be the user who executed the task. So that would be a great addition to have an extra association between workflowusertask and user.

 

For me the question is why do you need the user of the previous task? Can you describe the use case and what to do after a parallel split?

 

 

 

 

answered