CurrentUser and CurrentSession empty while trying to call microflow from a workfow.

0
  I am guessing empty CurrentUser and CurrentSession is the reason why I am not able to update my polarion instance.How to pass these two objects to the microflow? I have added parameters to the microflow but I don’t think workflow have that objects.Any help will be appreciated. Thanks in advance
asked
2 answers
0

A workflow doesn’t have a CurrentUser and CurrentSession in the context because it runs independently of users and sessions. 

 

If you want to pass these objects to your microflow, you can do so by associating them to the context object that you pass to the microflow via an association, e.g. MyContextObject_User.

  • A: If that input object is created before the workflow starts, you can directly do that in the action before the workflow is started (e.g. ACT_Request_Create). However, don’t associate the session object here because it can go lost in a later stage of the workflow.
  • B: If that input object is create during the workflow, you need to create it in a data source microflow that is called on a page (which runs in the context of the user).  

As an example for 1), take a look at the example of the ApprovalTemplate app.

 

answered
0

Hi Kaushal,

Workflows are executed in the Mendix Runtime, so current session and current user is always empty.

if you want to update the instance update try to retrieve from the database according your need.

 

https://www.mendix.com/evaluation-guide/app-lifecycle/workflows/#:~:text=Workflows%20are%20executed%20in%20the,separate%20from%20the%20main%20application.

 

answered